Advanced Mac OS X Programming: The Big Nerd Ranch Guide (Frank Feng's Library) by Mark Dalrymple

Advanced Mac OS X Programming: The Big Nerd Ranch Guide (Frank Feng's Library) by Mark Dalrymple

Author:Mark Dalrymple [Dalrymple, Mark]
Language: eng
Format: epub
Tags: Big Nerd Ranch Guides, Mac OS X Programming??, COM051370
ISBN: 9780321706546
Publisher: Big Nerd Ranch Guides
Published: 2011-07-31T16:00:00+00:00


A sample run

$​ ​.​/​p​e​r​m​t​y​p​e​ ​.​/​p​e​r​m​t​y​p​e​ ​o​o​p​a​c​k​ ​/​ ​/​d​e​v​/​k​l​o​g​ ​/​u​s​r​/​b​i​n​/​p​a​s​s​w​d​ ​n​o​b​o​d​y​-​h​o​m​e​ (​w​h​e​r​e​ ​o​o​p​a​c​k​ ​i​s​ ​a​ ​s​y​m​b​o​l​i​c​ ​l​i​n​k​)​ !​.​ .​/​p​e​r​m​t​y​p​e​ ​.​/​p​e​r​m​t​y​p​e​ ​/​ ​/​d​e​v​/​k​l​o​g​ ​/​u​s​r​/​b​i​n​/​p​a​s​s​w​d​ ​n​o​b​o​d​y​-​h​o​m​e​ .​/​p​e​r​m​t​y​p​e​:​ ​ ​p​e​r​m​i​s​s​i​o​n​s​:​ ​r​w​x​r​-​x​r​-​x​ ​ ​t​y​p​e​:​ ​R​e​g​u​l​a​r​ ​F​i​l​e​ ​ ​f​i​l​e​ ​i​s​ ​9​8​5​6​ ​b​y​t​e​s​ ​(​9​.​6​2​ ​K​)​ ​ ​u​s​e​r​:​ ​m​a​r​k​d​ ​(​5​0​1​)​ ​ ​g​r​o​u​p​:​ ​s​t​a​f​f​ ​(​2​0​)​ ​ ​l​a​s​t​ ​a​c​c​e​s​s​:​ ​T​h​u​ ​M​a​y​ ​2​6​ ​1​9​:​1​4​:​2​3​ ​2​0​1​1​ ​ ​l​a​s​t​ ​m​o​d​i​f​i​c​a​t​i​o​n​:​ ​T​h​u​ ​M​a​y​ ​2​6​ ​1​9​:​1​4​:​1​8​ ​2​0​1​1​ ​ ​l​a​s​t​ ​i​n​o​d​e​ ​c​h​a​n​g​e​:​ ​T​h​u​ ​M​a​y​ ​2​6​ ​1​9​:​1​4​:​1​8​ ​2​0​1​1​ /​:​ ​ ​p​e​r​m​i​s​s​i​o​n​s​:​ ​r​w​x​r​-​x​r​-​x​ ​ ​t​y​p​e​:​ ​D​i​r​e​c​t​o​r​y​ ​ ​f​i​l​e​ ​i​s​ ​1​2​9​2​ ​b​y​t​e​s​ ​(​1​.​2​6​ ​K​)​ ​ ​u​s​e​r​:​ ​r​o​o​t​ ​(​0​)​ ​ ​g​r​o​u​p​:​ ​a​d​m​i​n​ ​(​8​0​)​ ​ ​l​a​s​t​ ​a​c​c​e​s​s​:​ ​T​h​u​ ​M​a​y​ ​2​6​ ​1​9​:​1​4​:​1​8​ ​2​0​1​1​ ​ ​l​a​s​t​ ​m​o​d​i​f​i​c​a​t​i​o​n​:​ ​W​e​d​ ​M​a​y​ ​2​5​ ​1​7​:​0​3​:​2​1​ ​2​0​1​1​ ​ ​l​a​s​t​ ​i​n​o​d​e​ ​c​h​a​n​g​e​:​ ​W​e​d​ ​M​a​y​ ​2​5​ ​1​7​:​1​0​:​5​0​ ​2​0​1​1​ /​d​e​v​/​k​l​o​g​:​ ​ ​p​e​r​m​i​s​s​i​o​n​s​:​ ​r​w​-​-​-​-​-​-​-​ ​ ​t​y​p​e​:​ ​C​h​a​r​a​c​t​e​r​ ​S​p​e​c​i​a​l​ ​D​e​v​i​c​e​ ​ ​f​i​l​e​ ​i​s​ ​0​ ​b​y​t​e​s​ ​(​0​.​0​0​ ​K​)​ ​ ​u​s​e​r​:​ ​r​o​o​t​ ​(​0​)​ ​ ​g​r​o​u​p​:​ ​w​h​e​e​l​ ​(​0​)​ ​ ​l​a​s​t​ ​a​c​c​e​s​s​:​ ​T​h​u​ ​M​a​y​ ​2​6​ ​1​9​:​1​2​:​0​2​ ​2​0​1​1​ ​ ​l​a​s​t​ ​m​o​d​i​f​i​c​a​t​i​o​n​:​ ​S​u​n​ ​M​a​y​ ​ ​1​ ​2​1​:​4​8​:​1​4​ ​2​0​1​1​ ​ ​l​a​s​t​ ​i​n​o​d​e​ ​c​h​a​n​g​e​:​ ​S​u​n​ ​M​a​y​ ​ ​1​ ​2​1​:​4​8​:​1​4​ ​2​0​1​1​ /​u​s​r​/​b​i​n​/​p​a​s​s​w​d​:​ ​ ​p​e​r​m​i​s​s​i​o​n​s​:​ ​r​-​x​r​-​x​r​-​x​ ​ ​t​y​p​e​:​ ​R​e​g​u​l​a​r​ ​F​i​l​e​ ​ ​s​e​t​-​u​i​d​!​ ​ ​f​i​l​e​ ​i​s​ ​1​1​1​9​6​8​ ​b​y​t​e​s​ ​(​1​0​9​.​3​4​ ​K​)​ ​ ​u​s​e​r​:​ ​r​o​o​t​ ​(​0​)​ ​ ​g​r​o​u​p​:​ ​w​h​e​e​l​ ​(​0​)​ ​ ​l​a​s​t​ ​a​c​c​e​s​s​:​ ​S​u​n​ ​M​a​y​ ​ ​1​ ​2​1​:​3​5​:​3​6​ ​2​0​1​1​ ​ ​l​a​s​t​ ​m​o​d​i​f​i​c​a​t​i​o​n​:​ ​W​e​d​ ​M​a​r​ ​ ​9​ ​0​0​:​4​9​:​2​7​ ​2​0​1​1​ ​ ​l​a​s​t​ ​i​n​o​d​e​ ​c​h​a​n​g​e​:​ ​S​u​n​ ​M​a​y​ ​ ​1​ ​2​1​:​3​5​:​3​6​ ​2​0​1​1​ e​r​r​o​r​ ​w​i​t​h​ ​s​t​a​t​(​n​o​b​o​d​y​-​h​o​m​e​)​ ​:​ ​ ​2​ ​(​N​o​ ​s​u​c​h​ ​f​i​l​e​ ​o​r​ ​d​i​r​e​c​t​o​r​y​)​

Now, just to make your life a little more complicated, both Cocoa and Carbon have different kinds of metadata they bring to the table, including things like the HFS+ Creator and Type code for files, and whether the file extension should be hidden.

NSFileManager has a number of constants for use in the attribute dictionary returned by -[NSFileManager fileAttributesAtPath: traverseLink:]. There is some overlap with what you get from struct stat:

NSFileSize



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.