Re: Lock a file in cocoa

2010-03-19 Thread Ken Thomases
On Mar 19, 2010, at 1:36 PM, Charles Srstka wrote: > On Mar 19, 2010, at 11:04 AM, Jens Alfke wrote: > >> On Mar 19, 2010, at 5:17 AM, Don Quixote de la Mancha wrote: >> >>> How long do you need to prevent its removal? Just holding the file >>> open should prevent it from being deleted. >> >>

Re: Lock a file in cocoa

2010-03-19 Thread John Joyce
> > > This seems like a case where it might be good to know why you need to > prevent a file from being trashed. There is probably a better way to > accomplish what you need. > > _murat > > O It's not even Cocoa. What you are looking for is either file permissions (bad idea) OR keeping dat

Re: Lock a file in cocoa

2010-03-19 Thread Murat Konar
This seems like a case where it might be good to know why you need to prevent a file from being trashed. There is probably a better way to accomplish what you need. _murat On Mar 19, 2010, at 11:36 AM, Charles Srstka wrote: On Mar 19, 2010, at 11:04 AM, Jens Alfke wrote: On Mar 19, 2010,

Re: Lock a file in cocoa

2010-03-19 Thread Charles Srstka
On Mar 19, 2010, at 11:04 AM, Jens Alfke wrote: > On Mar 19, 2010, at 5:17 AM, Don Quixote de la Mancha wrote: > >> How long do you need to prevent its removal? Just holding the file >> open should prevent it from being deleted. > > Yes, but not from being moved to the trash, which was the OP’s

Re: Lock a file in cocoa

2010-03-19 Thread Jens Alfke
On Mar 19, 2010, at 5:17 AM, Don Quixote de la Mancha wrote: > How long do you need to prevent its removal? Just holding the file > open should prevent it from being deleted. Yes, but not from being moved to the trash, which was the OP’s request. Actually I’m not sure the immutable bit prevent

Re: Lock a file in cocoa

2010-03-19 Thread Don Quixote de la Mancha
Nikhil, On Fri, Mar 19, 2010 at 2:59 AM, Nikhil Khandelwal wrote: > Is there any way to lock a file in cocoa? I want to lock a file on desktop > programmatically so that I can't move that file to trash until I unlock the > file. How long do you need to prevent its removal? Ju

Re: Lock a file in cocoa

2010-03-19 Thread Ken Thomases
On Mar 19, 2010, at 4:59 AM, Nikhil Khandelwal wrote: > Is there any way to lock a file in cocoa? I want to lock a file on desktop > programmatically so that I can't move that file to trash until I unlock the > file. I recommend against doing that. Locking the file in thi

Re: Lock a file in cocoa

2010-03-19 Thread Ron Fleckner
On 19/03/2010, at 8:59 PM, Nikhil Khandelwal wrote: Hi, Is there any way to lock a file in cocoa? I want to lock a file on desktop programmatically so that I can't move that file to trash until I unlock the file. Thanks, Nikhil Hi Nikhil, here's how I do it: NSF

Lock a file in cocoa

2010-03-19 Thread Nikhil Khandelwal
Hi, Is there any way to lock a file in cocoa? I want to lock a file on desktop programmatically so that I can't move that file to trash until I unlock the file. Thanks, Nikhil DISCLAIMER == This e-mail may contain privileged and confidential information which is the proper