Re: Cannot get the content of a file (in iPhoto Library)
Re: Cannot get the content of a file (in iPhoto Library)
- Subject: Re: Cannot get the content of a file (in iPhoto Library)
- From: p3consulting <email@hidden>
- Date: Thu, 18 Sep 2003 21:51:13 +0200
I'm trying to read the content of every iPhoto library image with the
[NSFileHandle fileHandleForReadingAtPath:]. Everything works well
except for some file which I cannot get the content (the method returns
a NULL value). I have checked the file permission and I have added some
line of code before reading the file (with the following results):
- +[NSFileManager fileExistsAtPath:] returns YES.
- +[NSFileManager isReadableFileAtPath:] returns YES.
- +[NSFileManager contentsAtPath:] returns NO !!
fileExistsAtPath , isReadableFileAtPath , contentsAtPath are instance
methods not class methods:
thus
[[NSFileManager defaultManager] contentsAtPath:]
and not
[NSFileManager contentsAtPath:]
you should have compiler warnings if trying to use the later
Documentation doesn't specifies if [NSFileHandle
fileHandleForReadingAtPath] traverses symbolic link when NSFileManager
method does (but tilde in path should be expanded)
Also check the file you are trying to read:
a. permission is correctly set for the current user
b. is really a file and not a bundle
c. is not a symbolic link or an alias
d. everything that may be different from the "working" ones
Pascal Pochet
P3 Consulting
email@hidden
http://www.p3-consulting.net
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.