[Issue 7002] std.path needs a isValidFilePath function
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Nov 27 20:31:54 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7002
--- Comment #4 from Andrej Mitrovic <andrej.mitrovich at 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: -------
More information about the Digitalmars-d-bugs
mailing list