|Aug 31, 2007, 07:09 PM||#1|
fopen and paths in Xcode
I'm using Xcode for a C programming class, and while most of it is over my head, a lot of the features are really helpful. I'm a little puzzled about fopen, though. When I try this
fp = fopen("inventory.data", "r");
fp (which is a FILE*) is 0 during debugging. However, if I use the full path (/Volumes...) it works. I'm required to upload and compile my code on the school's servers, so using those paths is inconvenient. I've put the inventory.data file in my project folder along with the source files, and have added it under the source section in Xcode. Is there some way I can reference the file like this?
|Aug 31, 2007, 10:41 PM||#2|
Does relative files work i.e. fopen("./inventory.data" ...
or use #defines
#define MAC_OS_X #ifdef MAC_OS_X #define INV_FILE /Volume/.../inventory.data #else #define INV_FILE inventory.data #endif
"You can't solve you're problems with the same level of thinking that created the problems." - Einstein
New iMac 24"/G5 1.8/...
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|open and ipa in xcode||brandontod97||iPhone||0||Oct 19, 2011 07:27 PM|
|Reading and writing files and storage locations xcode||portreathbeach||iPhone/iPad Programming||1||Apr 2, 2011 06:22 PM|
|"Targets" and "Products" in XCode 4?||Danneman101||iPhone/iPad Programming||2||Mar 29, 2011 05:41 PM|
|using ifstream and ofstream in xcode||oicu4202||Mac Programming||8||Sep 18, 2009 07:12 AM|
|Trouble with paths in Xcode||Fenrir||Mac Programming||10||Mar 16, 2007 04:47 AM|
All times are GMT -5. The time now is 06:27 AM.