From: firewind Newsgroups: comp.os.msdos.djgpp Subject: Re: file_exists() Date: 23 Aug 1997 03:04:24 GMT Organization: Netcom Lines: 17 Message-ID: <5tljvo$5si@dfw-ixnews10.ix.netcom.com> References: <33fdf19a DOT 5293195 AT news DOT telepac DOT pt> <33fe2408 DOT 3775959 AT snews DOT zippo DOT com> NNTP-Posting-Host: elp-tx2-05.ix.netcom.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Peter J. Farley III wrote: > Perusing the DJGPP libc sources, it seems to me that access(filename, > R_OK) will give you the results that you want, without the overhead of > an fopen and an fclose. Just call: > access("filename.ext", R_OK) > Zero return value means the file is available for reading, which > implies that it actually exists. So this code should work: Keep in mind, however, that access() does not work for device files like "prn" and "nul", with or without the colon. Network files may not work either, I can't recall. late\fw