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

Jokerfwb

macrumors member
Original poster
Jan 22, 2012
32
0
I am taking a C++ class and i'm using Xcode to do all the projects, because it is just some much nicer then MS Visual, anyways. The project i'm on is about learning to read/write to a random access file using fstream and the such.
A part of the code creates a .dat file the fist time the program is ran. Everything works just fine when i compile and run but i can't seem to find where the .dat file is saved.

I have tried searching for it through finder but all it pulls up is the main.cpp file where it is created.
 

Sam Yikin

macrumors regular
Oct 28, 2007
230
0
Find your executable in your project window, right click, "Show In Finder", it should be in the same directory as the executable... which, because the executable is temporary, Xcode buries it deep within your ~/Library folder.

I like to make a folder in the project directory and create the file there.

EDIT: This was true in C. I assume c++ would be the same.
 

Jokerfwb

macrumors member
Original poster
Jan 22, 2012
32
0
/Users/jokerfwb/Library/Developer/Xcode/DerivedData/Assignment5-feulksjlyapgjpbrdzndpglhmygn/Build/Products/Debug

What you told me worked perfectly found the .dat file. The path i pasted is the path i get from right clicking on the file and clicking get info. The problem i have know is i can't navigate to it through Finder. After i click on user -> jokerfwb there is no library folder listed.

Also how do you go about creating a folder in the project directory and creating the file there?

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