Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!psuvax1!wuarchive!udel!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: access() Message-ID: <15103@smoke.brl.mil> Date: 6 Feb 91 19:36:30 GMT References: <1991Feb1.125713.14842@dce.ie> <15051@smoke.brl.mil> <3345@unisoft.UUCP> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 8 In article <3345@unisoft.UUCP> greywolf@unisoft.UUCP (The Grey Wolf) writes: >Sometimes, we only want to verify that a file exists, in which case it >is more tended to use access() for this. Yeah, well often it doesn't work, because the wrong permissions are checked for the path components. The safest way to test for file existence (on UNIX) is to stat() the presumed pathname and see if it succeeds.