Jump to content
  • Advertisement
Sign in to follow this  
_Sigma

fopen

This topic is 4000 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

Advertisement
Win XP.

I've been having some strange troubles with it, and this was one of the last things I could/can think of.

Share this post


Link to post
Share on other sites
In WinXP it is not case sensitive.

If you can describe in more detail of the original problem, we might be able to help you more.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
Depends on the underlying operating system.


Quote:
Original post by Crypter
In WinXP it is not case sensitive.


Nitpick: Depends on the underlying file system.

Share this post


Link to post
Share on other sites
One thing people easily forget is double quotes being automatically added by Windows, in some cases.
If your program gets the file name via command line or drag & drop, or maybe via the common dialog, likely it will be bounded with "" that you need to stripe before using fopen(). Double quotes, however, are only added when the file name would be unclear, without.

It's just a guess, without any more details I can't think of anything else ^^

Share this post


Link to post
Share on other sites
Quote:
One thing people easily forget is double quotes being automatically added by Windows, in some cases.
If your program gets the file name via command line or drag & drop, or maybe via the common dialog, likely it will be bounded with "" that you need to stripe before using fopen(). Double quotes, however, are only added when the file name would be unclear, without.

It's just a guess, without any more details I can't think of anything else ^^

Not the problem, but you sent me in the right direction. Many thanks.

The problem is that I am failing to strip off the last " in parsing my file.

If I have a line such as:

#include "myfile.as" // include the file we need

I want myfile.as

Currently I am using this:

newScript = newScript.substr(newScript.find_first_of("\"")+1,newScript.find_last_of("\"")-1);

where newScript would hold #include "myfile.as" // include the file we need

This is failing to strip off the last ". Is there an obvious reason why?

Share this post


Link to post
Share on other sites
The second argument of string::substr() is the length of the substring not the position of the end of the substring.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
The second argument of string::substr() is the length of the substring not the position of the end of the substring.

Ah. Well I have java to thank for this!

As always SiCrane, you're a fantastic help!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!