digitalmars.D.bugs - Possible bug in std.file.listdir (Linux)
- Timo Gransch (25/25) Jan 31 2007 Hi!
- Frits van Bommel (11/26) Jan 31 2007 [snip]
- Timo Gransch (5/7) Jan 31 2007 Sorry, I was blind. Works fine now. :)
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (5/8) Jan 31 2007 I think you mean "it hasn't been deemed fit for inclusion", it has been
- Bill Baxter (8/17) Jan 31 2007 Speaking of the underwhelming maintenance effort being put into the
- Frits van Bommel (6/15) Jan 31 2007 Right, now that you mention it I *do* remember someone having written a
Hi! Maybe I'm wrong, but I think I discovered a bug in std.file.listdir. -- [snip] -- import std.file; import std.path; import std.stdio; int main(char[][] args) { char Files[][]=listdir(curdir); foreach(char File[]; Files) { writefln(File); } return 0; } -- [snip] -- This works fine unless there is a file with a '%' in it's name in the current folder. If I put a file called for example "now_i_test%dmd" there, the program prints now_i_testError: std.format and exits. I have only tested it on Linux (Ubuntu 6.10 x86). Best regards, Timo
Jan 31 2007
Timo Gransch wrote:Hi! Maybe I'm wrong, but I think I discovered a bug in std.file.listdir.[snip]writefln(File);[snip]This works fine unless there is a file with a '%' in it's name in the current folder. If I put a file called for example "now_i_test%dmd" there, the program prints now_i_testError: std.format and exits. I have only tested it on Linux (Ubuntu 6.10 x86).Nothing to do with std.file.listdir, just with your use of writefln. writefln treats strings as format strings, except when a previous format string told it to treat it literally. Try this one: writefln("%s", File); There have long been requests for write & writeln (without the 'f') that just print out everything using the default formatting, but so far they haven't been implemented[1]. [1]: At least, in Phobos. I don't know about Ares/Mango/Tango.
Jan 31 2007
Frits van Bommel wrote:(...) Try this one: writefln("%s", File);Sorry, I was blind. Works fine now. :) Thanks for your fast reply, Frits. Best regards, Timo
Jan 31 2007
Frits van Bommel wrote:There have long been requests for write & writeln (without the 'f') that just print out everything using the default formatting, but so far they haven't been implemented[1].I think you mean "it hasn't been deemed fit for inclusion", it has been implemented multiple times by third parties. Basically it's a boolean... It's a pity that writeln and readln didn't make into DMD 1.0, I think. --anders
Jan 31 2007
Anders F Björklund wrote:Frits van Bommel wrote:Speaking of the underwhelming maintenance effort being put into the current standard library, what about our hope for salvation? The one that will have us all doing latin dances in the hallways? Yes, the one they call "TANGO"! Wasn't it supposed to be hitting the streets about now? Any updates on the ETA if it ain't gonna be today? --bbThere have long been requests for write & writeln (without the 'f') that just print out everything using the default formatting, but so far they haven't been implemented[1].I think you mean "it hasn't been deemed fit for inclusion", it has been implemented multiple times by third parties. Basically it's a boolean... It's a pity that writeln and readln didn't make into DMD 1.0, I think.
Jan 31 2007
Anders F Björklund wrote:Frits van Bommel wrote:Right, now that you mention it I *do* remember someone having written a patch. What was probably fresh in my mind as I wrote that was that just yesterday DMD caught me leaving out the 'f' again and complained about an unknown identifier :(.There have long been requests for write & writeln (without the 'f') that just print out everything using the default formatting, but so far they haven't been implemented[1].I think you mean "it hasn't been deemed fit for inclusion", it has been implemented multiple times by third parties. Basically it's a boolean... It's a pity that writeln and readln didn't make into DMD 1.0, I think.
Jan 31 2007