Tuesday, March 25, 2008

Why can I only access a file when running in the debugger?

If you are using relative paths such as in
FILE *file;
file = fopen("data.xml", "r");
the working directory may be the problem. The debugger may be setting up the working directory differently than Windows sets it when you execute the program. Windows will set the working directory to be the same as the directory of the executable, unless if it is launched by a shortcut. A shortcut will set the working directory according to its "Start in" parameter. If this parameter is empty, Windows will set the working directory to be the current user's home folder (under Documents and Settings in Windows XP).

1 comment:

Anonymous said...

10bet 10bet ミスティーノ ミスティーノ カジノ シークレット カジノ シークレット fun88 soikeotot fun88 soikeotot starvegad starvegad betway login betway login 카지노사이트 카지노사이트 온카지노 온카지노 ラッキーニッキー ラッキーニッキー 574