[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: proposed fileparts patch
From: |
Bill Denney |
Subject: |
Re: proposed fileparts patch |
Date: |
Thu, 23 Oct 2008 18:09:20 -0400 |
User-agent: |
Thunderbird 2.0.0.17 (Windows/20080914) |
Hall, Benjamin wrote:
> I agree that the ispc is ugly. I saw the is_sep_chars in the c++ and I agree
> that a better solution would use that information (rather than having
> effectively the same information in 2 different places). What would we call
> such a function, fileseplist or just dir_sep_chars? I'll attempt a patch at
> dirfns.cc for that next week.
>
> The only potential corner case is the filename 'c:somefile.txt', but I don't
> think that is good practice for specifying filenames (at least I don't intend
> to use it). If we ignore this case, then I think it will be possible to
> eliminate ispc() entirely.
>
There are a couple of bugs with assuming that every instance of \ or /
is a file separator. In *nix, "abc\123.m" could be a valid filename.
Again, it would be bad form, but it's definitely valid (I think that you
may be able to make a file "abc/123.m" in *nix if you work really hard
at it).
Those corner cases are corner enough that they are likely not worth
coding around, though.
Have a good day,
Bill