Re: Path manipulation in glib.h



> I'd opt for a set of path manipulation functions in glib.h (in addition
> to g_basename() and g_dirname():

Good idea. There is also g_path_is_absolute() and g_path_skip_root()
now, but something even more generic would be a Good Thing. Especially
if we want to support VMS, which usess different separators between
directory levels and beetween the directory path and the basename.

Of course, going through all code and change it to use the generic
functions, instead of assuming that the directory separator is a
single fixed character, etc, will take some time...

> 	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?

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?

--tml



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