Re: Create NSStrings from a mapped NSData object - safe?
Re: Create NSStrings from a mapped NSData object - safe?
- Subject: Re: Create NSStrings from a mapped NSData object - safe?
- From: Mike Fischer <email@hidden>
- Date: Wed, 14 May 2008 16:32:43 +0200
Am 14.05.2008 um 15:32 schrieb Michael Vannorsdel <email@hidden>:
I was going to with sample code to show it, but I didn't see any
documentation that said file locks and link counts were guaranteed.
See man unlink:
"[...] If that decrement reduces the link count of the file to zero,
and no process has the file open, then all resources associated with
the file are reclaimed. If one or more process have the file open
when the last link is removed, the link is removed, but the removal
of the file is delayed until all references to it have been closed."
The Finder (or its underlying API) was smart enough to check link
counts and gave notice the file was inuse. But rm just wiped it off
the FS and left nothing to map from. This tells me link counts and
locks are not checked by every FS API nor is it enforced at the FS
level.
If rm actually removed an open file (not the directory entry but the
file itsel) then that would be a serious bug and should be reported.
Mike
--
Mike Fischer Softwareentwicklung, EDV-Beratung
Schulung, Vertrieb
Note: I read this list in digest mode!
Send me a private copy for faster responses.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden