NSDistributedLock question
NSDistributedLock question
- Subject: NSDistributedLock question
- From: "Bill" <email@hidden>
- Date: Wed, 19 Apr 2006 12:51:03 -0700
I'm having some trouble using NSDistributedLock, and maybe someone
can shed some light.
In the Finder, I first create a new sample text file on my hard
disk. My application then does this:
// filename is the path to the text file I just created
NSDistributedLock *myLock = [[NSDistributedLock alloc]
initWithPath:filename];
// this works fine
NSDate *date = [myLock lockDate];
// I just created the sample text file, yet the NSDate returned is
valid. Who locked the file?
BOOL success = [myLock tryLock];
// this fails. Who has locked this file I just created? The File
Manager?
[myLock unlock];
// calling this causes the file to disappear (deleted?)!
Can anyone tell me what's going on, or what I'm doing wrong?
Thanks!
Bill
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden