• 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
Re: Create NSStrings from a mapped NSData object - safe?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Create NSStrings from a mapped NSData object - safe?
      • From: "Dennis Munsie" <email@hidden>
References: 
 >Re: Create NSStrings from a mapped NSData object - safe? (From: Mike Fischer <email@hidden>)

  • Prev by Date: Re: Efficient XML loading [continuation of NSString from mapped NSData thread]
  • Next by Date: Re: Efficient XML loading [continuation of NSString from mapped NSData thread]
  • Previous by thread: Re: Create NSStrings from a mapped NSData object - safe?
  • Next by thread: Re: Create NSStrings from a mapped NSData object - safe?
  • Index(es):
    • Date
    • Thread