Summary: std.path needs a isValidFilePath function
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos

--- Comment #0 from Andrej Mitrovic <> 2011-11-24 
13:10:38 PST ---
I currently see no way of verifying that a given path is a path to a *file* and
not a folder, IOW I want this assert to pass:


but the following one to fail, because 'file' in this case is syntactically a


Using basename and isValidFilename isn't a workaround as basename strips the

auto file = r"C:\folder\file\";
assert(file.baseName.isValidFilename);  // passes, baseName returns "file"

Either we implement a isValidFilePath function, or a "fileName" function which
could be used like so:

auto file = r"C:\folder\file\";
assert(file.fileName.isValidFilename);  // this would fail, as expected

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to