Re: What is O_EXCL short for?



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.

--
Måns Rullgård
mru@xxxxxxxxxxxxx
.