std.file bug? std.regex bug?

div0 div0 at users.sourceforge.net
Sat Jun 26 05:52:38 PDT 2010


On 26/06/2010 12:23, Simen kjaeraas wrote:
> Daniel Murphy <yebblies at nospamgmail.com> wrote:
>
>> 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?
>
> Not after I changed what was actually the problem - trailing spaces.
> Still, the error I got gave absolutely no indication that that might be it.
>
Yes it did. It told you exactly what was wrong.

The bit that says:

'The filename, directory name, or volume label syntax is incorrect.'

Its the error message from windows telling you that you got the file 
name wrong.

Trailing spaces are not allowed on windows, so it's not even tried to 
open a file, it's just told you that the file name syntax is wrong.

http://msdn.microsoft.com/en-us/library/aa365247(v=VS.85).aspx

Though perhaps the formatting of the exception text should be changed a 
bit to make it clear which bit is the system error part.

If it bothers you enough, it's worth filing a bug report:

http://d.puremagic.com/issues/

Andrei and the rest of the guys are pretty quick at knocking off these 
issues.

-- 
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk


More information about the Digitalmars-d-learn mailing list