06-29-05 10:53 PM
On Tue, 28 Jun 2005 niraj.kumar.ait@gmail.com wrote:
> How to check whether a file exists or not at its speciefied location
> .Is there any system call for this
You can use access(), stat(), or open() to check for a file's existance,
but if you plan to check for a file existance before opening, beware that
this introduces a race condition to your program. In this instance, it's
better to just open() the file and deal with any errors.
HTH,
--
Rich Teer, SCNA, SCSA, OpenSolaris CAB member
President,
Rite Online Inc.
Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich
[ Post a follow-up to this message ]
|