• Advertisement
Sign in to follow this  

[C++] Loading a file, ignoring case-sensitivity, on a linux platform

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

Hi all, My game intends to be cross platform between Windows and linux. How can I open a file ignoring linux' case-sensitivity? At the moment all my toolsets convert every model and texture filename to upper-case during conversion, and my resource manager only opens files in upper-case, but this isn't really a fix. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
The case-sensitivity comes from the used filesystem. You cannot assume which fs the user will use.

Keep every file in lower-case or upper-case. That is the only solution i know.

Some people rant about the case-sensitivity from *nix because it makes no sense to have files in a directory named: Foo and foo and FoO.

I keep on windows and Linux every file lower-case to avoid such problems. Beside that i like lower-case more then upper-case because it seems that somebody screams at me when i see it. (DOS screamed all the time. ^^)

Share this post


Link to post
Share on other sites
Quote:
Original post by deadstar

My game intends to be cross platform between Windows and linux. How can I open a file ignoring linux' case-sensitivity?


You really don't want to do this. Linux FS is case-sensitive. Foo, FoO and FOO are as different as foo, bar and baz.

It's not *that* hard to use consistent caps when creating an installer, or even the project.

Share this post


Link to post
Share on other sites
I'll stick with my current method then, all upper-case.

I know a lot of people whine about case sensitivity in some of the filesystems, but I'm actually all for it.

Eventually my engine will cater for some custom 'pak' or 'wad' file and it won't be a problem anyway.

Share this post


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

  • Advertisement