Plan for file processing libs
David Roundy
droundy at darcs.net
Sun Nov 26 09:44:55 EST 2006
On Thu, Nov 23, 2006 at 01:23:34PM +0300, Bulat Ziganshin wrote:
> Hello libraries,
>
> i think that ultimate structure for file-related libs should be the
> following, in the dependence order:
>
> * ByteString support
> * UnicodeByteString support
> * Stringable class that supports the common interface to String,
> UTF8ByteString, UTF16ByteString and so on
> * FilePath operations implemented via Stringable class
Except that for POSIX systems Stringable isn't the appropriate class for
FilePath operations, but rather ByteString. If you're thinking to rewrite
the IO libraries using a class to handle the FilePaths (which sounds like a
wonderful idea), it would make sense to try to think of a portable way to
do this.
I'm not sure what a portable approach would look like, but I'm afraid that
we'd need to make the datatype used abstract. Or at least we'd have to be
clear in the distinction between either a ByteString or a String and a
FilePath, because on POSIX systems a FilePath is a ByteString (or is
equivalent to one), while on Windows a FilePath is a String (or equivalent
to one).
Not wanting to simply throw mud in the waters, but it's all too easy to
completely ignore the non-windows half of the world, and for a proposed
core set of libraries, that'd be a real shame.
> * FileSystem operations (readdir, stat, copy, delete, mkdir...)
> implemented for Stringable arguments using FilePath module
--
David Roundy
Department of Physics
Oregon State University
More information about the Libraries
mailing list