http://d.puremagic.com/issues/show_bug.cgi?id=7002



--- Comment #4 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2011-11-27 
20:30:54 PST ---
I don't need to know if it's a file, that's std.file's business. I'm talking
strictly about string processing.

I want to reject paths that are clearly directories and not files. In other
words, *accept* paths which are valid file paths. I know well that a file can
be extensionless.

assert(path.endsWith(dirSeparator)) is what I want (but a call to isValidPath
beforehand is also required). I think it's standard enough to be included as a
"isValidFilePath" function.

========

Consider a build system where the user can specify a path to an output file,
even if that path or file might not exist:

build --output=C:\dir\name   <- pass
build --output=C:\dir\name\  <- reject this

I can't use isValidFilename here, it will reject both of these cases because it
only works on "name" and "name.ext" variants, if it sees any separators it
rejects it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to