Proposal: expose the drive functions in the filepath package

Bulat Ziganshin bulat.ziganshin at
Sat Jul 14 15:01:13 EDT 2007

Hello Ian,

Saturday, July 14, 2007, 4:39:33 PM, you wrote:

> The problem is that mingw's stat succeeds for C:\ and C:\foo but fails
> for C: and C:\foo\. The current code strips a trailing \ before calling
> stat, and thus fails if asked to create C:\ (which we always do if "make
> parents" is true, and of course this path could be given explicitly by a
> user).

> What we want is something like

>     if isDrive x
>     then addTrailingPathSeparator x
>     else dropTrailingPathSeparator x

well, i don't know FilePath library but if it has some sort of
canonizeFilename function, this function should make this check
yourself and shouldn't strip trailing '\' after ':' for obvious reason
- 'c:' and 'c:\' are different directories

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at

More information about the Libraries mailing list