Re: What is O_EXCL short for?
- From: phil-news-nospam@xxxxxxxx
- Date: 27 Dec 2006 17:41:46 GMT
On Tue, 26 Dec 2006 14:39:06 +0000 Måns Rullgård <mru@xxxxxxxxxxxxx> wrote:
| Ronald <followait@xxxxxxx> writes:
|
|> I don't understand why is it used with O_CREAT. Because a file can't
|> be created then.
|
| I believe it stands for "exclusive". It only makes sense together
| with O_CREAT, where its effect is to create the file only if it
| doesn't already exist. This is useful to avoid race conditions
| between several processes trying to create the same file, often a lock
| file.
The correct wording would be that it doesn't open the file if it
already exists. With your wording, if the file already exists it
could go ahead and open it but just not create it. But that would
not be of much value to have an option for as that is the default
behaviour with O_CREAT alone.
.
- References:
- What is O_EXCL short for?
- From: Ronald
- Re: What is O_EXCL short for?
- From: Måns Rullgård
- What is O_EXCL short for?
- Prev by Date: why inter-changing pci slot works?
- Next by Date: Re: source code of shell commands
- Previous by thread: Re: What is O_EXCL short for?
- Next by thread: union variable error(storage size isn't known)
- Index(es):