Exclusive file creation (Samba shares)
Exclusive file creation (Samba shares)
- Subject: Exclusive file creation (Samba shares)
- From: "marcel nita" <email@hidden>
- Date: Sat, 7 Apr 2007 20:07:36 +0300
Hello,
I have the following problem:
I have an app ( Win + Mac ) that stays connected to a samba share (
concurrent access ).
The purpose is to lock a directory( shared ) for exclusive access by
creating an empty lock file.
The lock file is created with open(...) using the _O_CREAT and _O_EXCL flags.
Using _O_EXCL I am guaranteed ( at least I thought so ) that open
returns an error if the file already exists.
The problem is ( I haven't been able to prove it yet ) that open
returns a valid file descriptor sometimes when both clients try to
create the lock file simultaneously. The result is not good - both
clients think that they have created the lock file and therefore have
exclusive access on that folder.
Has anyone else encountered this? Or, does anyone sees a problem in
this exclusive access mechanism?
I am not very familiar with the Samba protocol, so I do not know if
something like this is possible.
As usually, any suggestion is welcome.
Regards,
Marcel.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden