On Tue, 2009-04-28 at 09:28 +0200, Andrea Palmatè wrote: [...] > But next step is to understand how manage some > resources. The case is: > > 1) Windows > They have the first letter that is the drive and then there is a ":". So > this is the drive. Simply > > 2) Unix like > They have / that is the first char of a path. and then /usr is a > physical path. > > 3) Amigaos > We don't have nothing native related unix. For example we don't have > getenv("HOME") but we use PROGDIR:. We have CURRDIR: that is the current > dir and so on > Our devices, or assigments are with variable length size. For example we > could have "THISISMYDISK:" or, for example, "C:" that point to the > command directory and that is an assign. > We could have also an assignment or a disk called HTTP:... > Luckily we have a lib that we use when compiling unix like program > called -lunix that can convert from unix to amigaos and from amigaos to > unix. Indeed if I use in the program /progdir, libunix convert it into > PROGDIR: at runtime > > Now the question is. > I'm sure (because 99,9% of unix program do so) that there is in the code > something related getenv("HOME") (and i found it..) but iirc there is > something related also on if (dir[0] != '/' && dir[1] == ':' ) then is a > windows drive. > How can I manage it?
What about: if (dir[0] != '/' && dir[0] != '\0' && dir[strlen(dir) - 1] == ':') then it is either a M$ drive-spec or a native AmigaOS drive-spec. Is your goal to detect a native M$ AmigaOS drive-spec? Sincerely, Richard Wilbur P.S. I still have a couple Amiga's I haven't unpacked since our last move :>) _______________________________________________ Gnash-dev mailing list Gnash-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-dev