Index:
[thread]
[date]
[subject]
[author]
From: Neal Tucker <ntucker@vax.area.com>
To : ggi-develop@eskimo.com
Date: Thu, 6 Aug 1998 06:35:20 -0700
Re: / vs \ [Re: PenguinPlay IRC meeting. GGI developers wanted]
becka@rz.uni-duesseldorf.de wrote:
> > * A general file I/O system. Provides functinality similar to the
> > GNU coustom streams or C++ stdstream, only
> > portably and in C. (Specifically we want this to allow loading
> > from "archive files").
>
> Yeah - and "file-dialogs" and separators and such should be abstracted ...
> You know that DOS \ vs Unix / thing ...
An approach I have used for this in the past, which worked very well,
was to represent paths as URL's as much as possible. You need some
simple utilities to convert a path to and from a URL based on your
platform, but it's really convenient that the path separators and
allowed chars are really well defined for URL's, and URL's are used on
all platforms.
I started using this when working on a cross-platform mac/windows
program which I wanted to be portable to UNIX too, and found myself
trying to juggle 1) Path separators (\, /, and :), 2) volume identifiers
( "c:/path/path" vs "volume:path:path" vs nothing), and 3) conventions
for indicating whether a path is relative or absolute (on the mac, a
path is relative if you *include* a path separator at the beginning...
i.e. :dir:dir2:file is a relative path...go figure). It turns out
it all boils down to one easy set of rules if you use URL's.
-Neal Tucker
Index:
[thread]
[date]
[subject]
[author]