Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Xcode create .txt files to?

Tags:

c++

file

location

http://www.cplusplus.com/doc/tutorial/files/

I just finished executing this but I didn't get any file on my desktop.

So where does the .txt file get placed on my computer?

// basic file operations
#include <iostream>
#include <fstream>
using namespace std;

int main ()
{
    ofstream myfile;
    myfile.open ("example.txt");
    myfile << "Writing this to a file.\n";
    myfile.close();
    return 0;
}
like image 274
Josh Smith Avatar asked Nov 04 '12 03:11

Josh Smith


People also ask

Where are TXT files stored?

This file is located in data/data/your.package.name/files/ folder.

Where does Xcode save output?

Clearing Derived Data. When you build a project, Xcode stores build files for that project in your derived data. You'll find your derived data folder in your macOS user library. To find your derived data folder, open a new Finder window.

How do I find files in Xcode?

To find text in a file, open the file in the Xcode source editor and choose Find > Find from the menu bar. Xcode displays the Find bar and its search controls at the top of the file. Enter a search term. Xcode searches the file, highlights matches, and notes how many it finds.

How do I use text files in Xcode?

To add a text file to the project, right-click on the project folder in the project view in the left pane and select the option New Item... In the dialog that appears, select the Other category and the Empty file option. Name the file numbers. txt.


2 Answers

Damn... I've seen this post never answered many times..

Here's the solution

In your project navigator when you're working in your current project there are many files. Try products (if I remember) and look for the executable file. Now go to the properties inspector or whatever is called. (Right side of your Xcode.)

There you will find somewhere a part called PATH the path that is written over there. It's the path where the executable runs. That means there is where you'll find all the files you create with your program.

Try it... that's how I manage and look my .txt files since sometimes I wanna give them some kind of formatting.

I hope I've solved your problem... cheers! ;)

like image 196
SuEric Avatar answered Oct 11 '22 13:10

SuEric


Click on the executable in the Products tab on the left hand side, and you should see the path to it displayed on the right in the utilities section. This is where they are saved. On my computer this path is:

/Users/myName/Library/Developer/Xcode/DerivedData/CurrentXcodeProject-adsnvetbleazktcgitfymfcbhkkt/Build/Products/Debug/filename.txt

like image 45
Tyler Avatar answered Oct 11 '22 14:10

Tyler