Date: Sun, 16 May 1999 21:55:20 +0200 From: Frank Heckenbach Message-Id: <1C551283.19990516215520.FOO-2C58.frank@goedel.fjf.gnu.de> X-Mailer: smtphack 0.3.4 by Jan Andres To: eliz AT is DOT elta DOT co DOT il, djgpp-workers AT delorie DOT com Subject: Re: realpath() Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 Reply-To: djgpp-workers AT delorie DOT com > > : Otherwise it returns a NULL pointer and places in > > : resolved_path the absolute pathname of the path component > > : which could not be resolved. > > This is not very specific, and in fact I could interpret this in several > ways. Could you please throw together a short test program and see what > it does with non-existent file names? #include #include #include #include int main () { char resolved_path [MAXPATHLEN]; char *rp; printf ("Trying /bin/../usr/bin/foo/bar/baz\n"); rp = realpath ("/bin/../usr/bin/foo/bar/baz", resolved_path); printf ("realpath returns: %s\n", rp ? rp : "NULL"); printf ("resolved_path contains: %s\n\n", resolved_path); printf ("Trying /usr/../bin\n"); rp = realpath ("/usr/../bin", resolved_path); printf ("realpath returns: %s\n", rp ? rp : "NULL"); printf ("resolved_path contains: %s\n\n", resolved_path); return 0; } Under Linux (2.2.7, libc 5.4.46) it says: Trying /bin/../usr/bin/foo/bar/baz realpath returns: NULL resolved_path contains: /usr/bin/foo Trying /usr/../bin realpath returns: /bin resolved_path contains: /bin (/usr/bin/foo, of course, does not exist on my system.) Frank -- Frank Heckenbach, frank AT fjf DOT gnu DOT de http://fjf.gnu.de/ PGP and GPG keys: http://fjf.gnu.de/plan