Possible bug in std.file.listdir (Linux)
Frits van Bommel
fvbommel at REMwOVExCAPSs.nl
Wed Jan 31 13:54:41 PST 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.
More information about the Digitalmars-d-bugs
mailing list