This topic is now archived and is closed to further replies.


<stdio.h>::fopen, ignores <direct.h>::chdir

Recommended Posts

I'm using relatively basic file I/O, with a simple structure that encapsulates (stdio.h)::FILE*. I store my data files in different directories than my executable image. I am currently just using "absolute file paths" for accessing the data files, but I want to improve this. It's fairly easy to just do some simple string manipulation on the "Current Working Directory" ((direct.h)::getcwd()) to obtain relative paths, but I'd prefer a more elegant solution. It seems ::fopen()'s default path is the location of the executable image, and is unaffected by ::chdir(). Is there any way to change the path variable for (stdio.h)? I am Using: WindowsXP Visual C++ 6.0 (But my project is cross-platform with Linux, maybe OSX later) edit: that'll teach me for trying to use tag tokens as standard text. edit: um, seems I was wrong about it being unaffected anyway. suddenly it just started working. EDIT: PROBLEM FIXED: DON'T NEED TO REPLY [edited by - Krylloan on October 13, 2003 5:47:32 PM]

Share this post

Link to post
Share on other sites