• 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: Cannot get the content of a file (in iPhoto Library)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Apple nice web pages: how to do?
  • Next by Date: Re: NSSaveView and odd NSCFArray errors
  • Previous by thread: Re: Cannot get the content of a file (in iPhoto Library)
  • Next by thread: Cannot read file content (sorry!)
  • Index(es):
    • Date
    • Thread