Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Inconsequential

macrumors 68000
Original poster
Sep 12, 2007
1,978
1
Basically this is for my aero eng course, so no changing coding language ;)

Im trying to open a file from where Xcode stores the executable, IE in the debug folder.

Code:
	/* open file for input */
	inf=fopen("datafile.txt","r");

Reads it from my home folder (Where the docs folder etc is).

I would like it to read from the Debug folder in the project folder.

I've tried a few things but with no success.

Anyone help?

Cheers!
 

Berlepsch

macrumors 6502
Oct 22, 2007
303
48
Did you try something like

fopen ("/this/is/the/path/to/my/Debug/file.txt", "r")​

yet?
 

Inconsequential

macrumors 68000
Original poster
Sep 12, 2007
1,978
1
Edit: Ok, thats weird!!

Now it works with the full path where it didn't yesterday!!!

Oh well, all is good now.

Thanks people :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.