Re: Path manipulation in glib.h



Quoting Tor Lillqvist (tml@hemuli.tte.vtt.fi):

> >	C:\WinNT\Fonts\Arial.ttf -> { "", "C", "WinNT", "Fonts", "Arial.ttf", NULL }
>
> Hmm, what's the semantics of the empty first element in the array? And
> how should one distinguish between X:\foo\bar.zap and X:foo\bar.zap,
> where X isn't the current drive?

Is X:foo\bar.zap a valid path ? What does it mean ? If it means
"foo\bar.zap in the current directory on X:", then the code would
have to do this:

    if (isalpha (path[0]) && path[1] == ':' && path[2] != '\\') {
	- Find the current path on X:
	- Construct X: + "current path on X" + foo\bar.zap
	- split this path
    }

What worries me more is the UNC paths :-/

> Yes, the concept of per-drive current directories has to be one of the
> most brain-damaged things in the DOS/Windows world. But, uh, if we
> really want to support Windows, I guess it should be taken into
> consideration... Are there other similarly strange semantics in VMS
> for instance? MacOS has a single-rooted file system, hasn't it?

Well, here are some AmigaOS paths:

    DEVS:Mountlist  -> "", "DEVS", "Mountlist", NULL
    //file.c	    -> "/", "/", "file.c", NULL...
	    this is equivalent to "../../file.c"...
    dir//file.c     -> "file.c", NULL

Here is how it works:

    name: is either a device driver or a directory
	on some harddisk.

    / separates directories *or* is the parent directory. It's the
	parent directory if the char before the / is : or /.

    All chars of the ISO-8859-1 are ok for dirs and filenames.

--
Dipl. Inf. (FH) Aaron "Optimizer" Digulla     Assistent im BIKS Labor, FB WI
"(to) optimize: Make a program faster by      FH Konstanz, Brauneggerstr. 55
improving the algorithms rather than by       Tel:+49-7531-206-514
buying a faster machine."                     EMail: digulla@fh-konstanz.de



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]