std.file bug? std.regex bug?
Daniel Murphy
yebblies at nospamgmail.com
Sat Jun 26 03:57:39 PDT 2010
It could be that the string returned from the regex looks the same as the
hardcoded string but contains characters that don't show up when you print
it.
Does adding
assert(regexResult == expectedFilename);
throw?
"Simen kjaeraas" <simen.kjaras at gmail.com> wrote in message
news:op.vewf53itvxi10f at biotronic-pc.lan...
>I have this weirdest bug. I'm extracting a list of files from a file,
> using std.regex. Then, I try to open each of these, using
> std.file.readText. This gives me this error:
>
> std.file.FileException: In std\file.d(198), data file data: The
> filename, directory name, or volume label syntax is incorrect.
>
> Now, the funny thing is, the filename given (data) is wrong. The
> filename extracted (and confirmed, by printing it) is data.ini. If I
> hardcode the file name, no problem occurs.
>
> So, printing the filename confirms that the regex works, and
> hardcoding it confirms that readText works. Nothing else does
> anything to the filename.
>
> Does anyone have the slightest idea what might be wrong?
>
> --
> Simen
More information about the Digitalmars-d-learn
mailing list