How to fopen() on the iPhone?
问题 The iPhone SDK docs claim fopen() is a supported method of file access but I am unable to get it to return a FILE handle. I am accessing a directory which is included in my project. I have tried fopen "filename","dir/filename","./filename","./dir/filename","/dir/filename" all returning with a null pointer. Some people report using it with no issue so I am sure it is something simple! 回答1: if you're trying to access a file within your application bundle, you need to get the full path to it: [