Re: How do I check the existence of a file programmatically in C?q~~.
From: Rich Teer (rich.teer_at_rite-group.com)
Date: 09/01/05
- Next message: Andreas F. Borchert: "Re: blastwave.org S.O.S."
- Previous message: Rich Teer: "Re: Rackmount Sun Hardware"
- In reply to: doomster_at_gmail.com: "How do I check the existence of a file programmatically in C?"
- Next in thread: Anton Petrusevich: "Re: How do I check the existence of a file programmatically in C?q~~."
- Reply: Anton Petrusevich: "Re: How do I check the existence of a file programmatically in C?q~~."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 01 Sep 2005 15:27:12 GMT
On Wed, 31 Aug 2005, doomster@gmail.com wrote:
> I want to check to see if a file exists before I try to open it. If it
> doesn't exist, I will report an error.
This is nearly always a bad idea. Just let the open fail if the file
doesn't exist. WHy? COnsider this time line if you use access() or
the like:
Proc A Proc B
access (succeeds)
Deletes file
open (fails even though you think it won't)
-- 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: Andreas F. Borchert: "Re: blastwave.org S.O.S."
- Previous message: Rich Teer: "Re: Rackmount Sun Hardware"
- In reply to: doomster_at_gmail.com: "How do I check the existence of a file programmatically in C?"
- Next in thread: Anton Petrusevich: "Re: How do I check the existence of a file programmatically in C?q~~."
- Reply: Anton Petrusevich: "Re: How do I check the existence of a file programmatically in C?q~~."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|