13.07.2015 Views

Beginning Objective-C pdf - EBook Free Download

Beginning Objective-C pdf - EBook Free Download

Beginning Objective-C pdf - EBook Free Download

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

118CHAPTER 5: Using the Filesystembookmark data, and NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess states that youonly wish to gain read access to the bookmarked item, not write access.When resolving a bookmark, you specify the NSURLBookmarkResolutionWithSecurityScopeoption to have the relevant access privileges prepared by the sandboxing system. After this, youwrap any use of the item at the URL with calls to -startAccessingSecurityScopedResource and-stopAccessingSecurityScopedResource, which together actually obtain and return the relevantaccess privileges from the system.Filesystem MetadataOS X and iOS both have a filesystem-level metadata system based around the concept ofextended attributes. These attributes use string-based names in UTF-8 format, and the dataassociated with that name can be anything at all. Finder information (the locations of icons in thegrid view, visibility status, and others) is stored using extended attributes, for example, and TimeMachine backups track a lot of information using them, too.You can see details of extended attributes easily from the Terminal application. For example,if you open the Terminal app and change to the root directory (type cd / at the prompt) youcan use ls -l@ to view extended attributes for all files and folders there. The output will looksomething like that in Listing 5-8. The FinderInfo entries on most of these items are used tospecify that these items be hidden in the Finder.Listing 5-8. Extended Attributes on the Command LineLP-347 / " ls -l@total 30453drwxrwxr-x+ 70 root admin 2380 2 Jun 15:00 Applicationsdrwxr-xr-x+ 64 root wheel 2176 3 Jun 22:54 Librarydrwxr-xr-x@ 3 root wheel 102 2 Jun 13:29 Networkcom.apple.FinderInfo 32drwxr-xr-x+ 4 root wheel 136 1 Jun 20:06 Systemlrwxr-xr-x 1 root wheel 60 4 Apr 14:05 User Guides And Information ->/Library/Documentation/User Guides and Information.localizeddrwxr-xr-x 6 root admin 204 1 Jun 16:01 Usersdrwxrwxrwt@ 4 root admin 136 3 Jun 19:45 Volumescom.apple.FinderInfo 32drwxr-xr-x@ 39 root wheel 1326 1 Jun 20:04 bincom.apple.FinderInfo 32drwxrwxr-t@ 2 root admin 68 16 Aug 2011 corescom.apple.FinderInfo 32dr-xr-xr-x 3 root wheel 4417 2 Jun 13:28 devlrwxr-xr-x@ 1 root wheel 11 18 Nov 2011 etc -> private/etccom.apple.FinderInfo 32dr-xr-xr-x 2 root wheel 1 3 Jun 19:52 home-rw-r--r--@ 1 root wheel 15567576 9 Apr 22:34 mach_kernelcom.apple.FinderInfo 32dr-xr-xr-x 2 root wheel 1 3 Jun 19:52 netdrwxr-xr-x@ 6 root wheel 204 18 Nov 2011 privatecom.apple.FinderInfo 32drwxr-xr-x@ 62 root wheel 2108 1 Jun 20:04 sbinwww.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!