[Issue 7001] std.path.baseName and isValidFilename wrong documentation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 6 21:05:53 PST 2011


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


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com


--- Comment #2 from Jonathan M Davis <jmdavisProg at gmx.com> 2011-12-06 21:05:51 PST ---
And how does isValidFilename not validate directory names?

There's no really zero difference between a file and a directory as far as
paths go except anything to the left of the rightmost directory separator must
be a directory or drive. I believe that both std.path and std.file have a
tendancy to use the term file even when it applies to directories - which is
fairly typical in such documentation, I believe - though in some cases it can
be confusing. Already, as far Posix is concerned, what you'd typically refer to
as a file would be a "regular" file rather than a file.

In any case, baseName is arguably correct as-is, though it certainly wouldn't
hurt to add "or directory" to it, and I don't see what's incorrect about
isValidFilename. It validates a file or directory name. The only complaint in
that regard that I can think of that you might be making is the fact that
something like "dir/" would return false for it, and since directory separators
are invalid in both directory and file names, I don't see that as a problem.
So, unless you have another argument that I can't think of, I don't know what
your issue with isValidFilename could be.

-- 
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