Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show current folder for ifstream in debugger

I am debugging an executable which tries to load a file using

ifstream is("filename");

This fails because in the 'current folder' this file seems to be missing. I am pretty sure the file is in the folder containing the project and solution and the working directory is set to project-dir.

Question: is there a way to show the folder where ifstream will look for the file in the debugger?


Edit 1: Getting information about the current project dir can be done like this:

How can I find out the value of $(ProjectDir)?


Edit 2: The current working dir can be obtained like this:

 char * dir = _getcwd(NULL, 0);    

I have not found a way to get this information in the debugger without recompiling which would be much nicer.

like image 584
Beginner Avatar asked Jan 19 '26 15:01

Beginner


1 Answers

Process Explorer is a tool available from microsoft.com

It will show the active directory of all running processes.

enter image description here

like image 177
Beginner Avatar answered Jan 21 '26 06:01

Beginner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!