Re: How to check whether file exists or not
From: Rich Teer (rich.teer_at_rite-group.com)
Date: 06/29/05
- Next message: Rajan: "full list of processes running in AIX"
- Previous message: Rich Teer: "Re: Page break in man page messes up a table"
- In reply to: niraj.kumar.ait_at_gmail.com: "How to check whether file exists or not"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 29 Jun 2005 14:34:20 GMT
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
- Next message: Rajan: "full list of processes running in AIX"
- Previous message: Rich Teer: "Re: Page break in man page messes up a table"
- In reply to: niraj.kumar.ait_at_gmail.com: "How to check whether file exists or not"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]