PDA

View Full Version : Reading/writing files in Carbon?


ia3n_g
2006.07.23, 10:01 PM
Can anyone point me to some sort of reference for how to read to and write from files in Carbon? I have decent programming experience on UNIX computers from school and am used to using the whole FILE * /fprintf setup, but that seems to work only when I launch my app from Xcode, not if it is run by double clicking th app from the Finder. Thanks in advance.

ThemsAllTook
2006.07.23, 10:19 PM
stdio works fine in a Carbon or Cocoa application, but your initial working directory may not be where you expect it to be. It's different when running from Xcode than when launched from the Finder or in other situations.

See the CoreFoundation example here:
http://tips.onesadcookie.net/tips/published/Where%27s+my+File%3F

ia3n_g
2006.07.23, 10:54 PM
Oh, thanks, that works. I didn't even think to go hunting for it elsewhere.