Although the source file is stored in the folder 'src' in the project folder, it seems any paths for file I/O in the code is done relative to the parent project folder and not 'src' folder. This leads to the undesired behavior where even the compiled binary processes any paths as being relative to the parent folder of the folder that contains the binary.
Is there a way to set the working directory to be where the binary is stored and not its parent folder?
Kind of hard to explain but if you have the binary stored like this:
and if binary.xe has:Folder 1
|-Folder 2
|-|-binary.xe
|-|-file.txt
Code: Select all
fd = _open("file.txt", O_RDONLY, 0);
If file.txt was moved to Folder 1, the _open succeeds.
Please help.
Thanks