Jump to content
  • Advertisement

Archived

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

Krylloan

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

This topic is 5391 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!