[Haskell-cafe] File path programme

Glynn Clements glynn at gclements.plus.com
Sun Jan 30 09:23:39 EST 2005

Keean Schupke wrote:

> >I guess it's just that I'm more concerned with making possible what is
> >currently impossible (according to the library standards)--that is, using
> >FFI and IO on the same file--rather than just adding utility features that
> >application developers could have written themselves.  I suppose we don't
> >need a class for this, all we need is a couple of functions to convert
> >between FilePath and CString.
> >  
> >
> Except paths are different on different platforms... for example:
> /a/b/../c/hello\ there/test
> and:
> A:\a\b\
> notice how the backslash is used to 'escape' a space or meta-character on
> unix,

That's Bourne-shell syntax, not Unix API syntax. So far as open() etc
are concerned, a backslash is just another character.

Also, Windows accepts both slash and backslash equally in most
situations. It's only really command-line parsing (where slash is
normally used to denote switches) where there's an issue.

Glynn Clements <glynn at gclements.plus.com>

More information about the Haskell-Cafe mailing list