announcing darcs

David Roundy droundy@jdj5.mit.edu
Thu, 10 Apr 2003 07:56:20 -0400


On Wed, Apr 09, 2003 at 04:02:36PM +0100, Alastair Reid wrote:
> 
> This reminds me of a library I have been wanting for a while:
> functions for manipulating filenames in a portable way.  The main
> requirement is that you should be able to manipulate a filepath as
> though it was structured something like so:
> 
>   (Maybe [Directory], Maybe Filename, Maybe Suffix)
> 
> For example, on a Unix system, /usr/lib/libcurl.so would be
> treated something like this:
> 
>   (Just ["/","usr","lib"], "libcurl", Just "so")

I'm thinking a better definition (similar to Keith's objection, but
different) would be something like:

(Origin, [Directory], Maybe Filename, Maybe Suffix)

where Origin is a string which gives the absolute origin of the path.
In the case of relative paths this would either be "." or "" (we'd have to
choose either one or the other).  I think that the origin of the path (btw
I don't like the name Origin here) is a unique item.  Keith gave the
example of an scp style path abridgegame.org:my/file, but there is also the
issue of dealing with windows paths C:\\whatever (where we obviously don't
want to interperet this as being in a directory named "C:" which is in the
current directory).
-- 
David Roundy
http://www.abridgegame.org