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: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 14 May 2008 17:05:31 +0200
Le 14 mai 08 à 16:32, Mike Fischer a écrit :
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.
At least on HFS+ volume, if one process uses a file, rm does not
remove it but move it somewhere nobody can find it until it is no
longer used (there is some folder that cannot be access using path on
HFS volumes). Then it is deleted.
_______________________________________________
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