• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Exclusive file creation (Samba shares)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Next by Date: Set Document Icon from Command Line
  • Next by thread: Set Document Icon from Command Line
  • Index(es):
    • Date
    • Thread