I am creating then writing to a text file using QTextStream. The problem is that the file is created if I build the application and run it from folder it creates, but if I run it from inside Qt in either release or debug mode it doesn't create the file. Does anyone have any suggestions? I am using a Macbook Pro.
Asked
Active
Viewed 229 times
1 Answers
1
You probably used a relative path, and inside QtCreator the "current directory" from where the executable is ran is not necessarily the directory where the executable is.
Try:
qDebug() << QDir::currentPath();
It will tell you where you should expect your file to be written.

Boris Dalstein
- 7,015
- 4
- 30
- 59
-
Thank you. The current path was in this weird hidden place, so I just changed it to an absolute path. – Chris Graham Sep 11 '13 at 03:54