On Apr 23, 2:00 am, Philo <philo....@gmail.comwrote:
Quote:
On Apr 23, 6:12 am, Ian Collins <ian-n...@hotmail.comwrote:
[...]
Quote:
Quote:
<OT>Any pathname starting with a '/' is a full pathname.</OT>
Quote:
Any pathname starting with a '/' is a full pathname?
Are you sure of that?
Well, it depends on the system. (That's why he put the <OT>
around it, I'm sure.) Under Unix, any pathname starting with
'/' (and no other pathnames) is an absolute pathname; i.e. a
pathname taken from the system root, and not from the current
directory. The rules for Windows are considerably more
complicated, but any pathname starting with '/' or '\\' is
interpreted as an absolute pathname on the currently selected
drive, taken from the root of the currently selected drive;
there are also other formats which are considered absolute. I
match the regular expression:
absolute( "[[:alpha:]]:"
"|[/\\\\][/\\\\][^<>:\"/\\\\\\|]+[/\\\\][^<>:\"/\\\\\\|]
+" ) ;
in my own code. (Note that both the compiler and the regular
expression parser interpret backslashes, so that it takes four
backslashes in a row to literally match a single backslash, and
two for the regular expressions parser to see it. So that
something like "\\\\\\|" means a literal backslash, followed by
a literal | character.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34