I've had a few problems with this example program, but I have managed to work around them.
Firstly, you need to know where your program is store, so after NSDictionary *attri; line put:
system ("pwd; ls -l");
This will then give you the path name using a typical unix command. You can then use Finder to browse to this location.
Secondly, create the "testfile" using the method described on page 374. If you create a file using the text editor it's an RTF type and therefore has more in it! You can tell when you look at the files sizes as the RTF is considerably larger.
To be fair to Mr Kochan he does on page 376 describe that the files are in a different location than where you'd expect them to be! However, I'd put in a couple of test lines that didn't work:
if ([fm changeCurrentDirectoryPath:@"~"]
== NO ) {
NSLog(@"Unable to change directory");
}
NSLog(@"Current path %@", [fm currentDirectoryPath]);
Which reports that it's unable to change director, and then that the current path is (null). Any suggestions why please? I think I'm about to battle this in the next exercise!