access()

M.T.Russell mtr at ukc.ac.uk
Thu Feb 7 22:05:29 AEST 1991


In article <15103 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
>                                  The safest way to test for file
>existence (on UNIX) is to stat() the presumed pathname and see if
>it succeeds.

On BSD systems lstat() is often better, as stat() will return
a wrong negative result for a symbolic link that points to a
non-existent file.

Mark



More information about the Comp.lang.c mailing list