Author Topic: [8]Case sensitivity for windows too  (Read 3139 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
[8]Case sensitivity for windows too
« on: 31 May 2016, 19:23:46 »
Currently we often have the problem that mods work for Windows but not for linux. The reason are case sensitivity problems when opening files. Linux s case sensitive, windows is not.

We should either make linux file opening non case sensitive too or we force windows to be case sensitive.
In my opinion its more correct what linux does and its easier to implement an extra check too . So we should implement and use our own "fopen" to archive this which does extra checks for windows too.
Something like mgFopen() ( this can maybe handle platform specific things too )
« Last Edit: 14 March 2017, 23:54:59 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: [8]Case sensitivity for windows too
« Reply #1 on: 3 June 2016, 05:56:25 »
Definitely possible, since Windows preserves case. Could check that the path you retrieved matches the expected case.

There is the possibly ugly issue of having multiple files with only case differences that could not be opened on Windows at all since they'd conflict on the file system, but there's no clean way of handling that, anyway (and I'd consider it a terrible idea to have multiple files with only case differences).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

GunChleoc

  • Horseman
  • ****
  • Posts: 202
    • View Profile
    • Fòram na Gàidhlig
Re: [8]Case sensitivity for windows too
« Reply #2 on: 6 June 2016, 13:01:25 »
I seem to remember reading somewhere that best practices are as follows:
  • When loading, assume that filenames are case-sensitive
  • When saving, assume that filenames are case-insensitive
And of course don't ship files with the game that might confuse Windows.

filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
Re: [8]Case sensitivity for windows too
« Reply #3 on: 8 June 2016, 21:24:08 »

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: [8]Case sensitivity for windows too
« Reply #4 on: 23 March 2017, 20:43:47 »
I hate this topic because it sounds more like its Windows bashing, And you (titi) think the linux way is "the right way" personally i think the "windows way" is better, alone for the fact it solves alot of problems with a capital letter sneaking in now and then, From my view checking for case sensetivity in filenames are dumb, to keep my laungage nice.

If you want to change how the game check files, Do it. But don't blame windows for it. If anything you could say windows is more fault tolerant in this regard.

the _ONLY_ benefit i can see to this is that modders on windows can know when thier mod will crash on linux system for aparently not reason, Also, if you are so determined about this, create a script or validation feature wich makes sure that all references is the same letterm big or small.

(this thread rubs me so much the wrong way, Blaming windows for something that is a "feature" in linux)
WiP Game developer.
I do danish translations.
"i break stuff"

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: [8]Case sensitivity for windows too
« Reply #5 on: 23 March 2017, 22:10:31 »
Oh you had a bad day ? ::)

ok me too:
This game is cross platform and all systems have case sensitivity just windows does it the unusual way.
But we want to have the same behaviour on ALL platforms to ensure compatibility.
btw these days this game is developed using linux and the windows version is just a game port somehow!
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
Re: [8]Case sensitivity for windows too
« Reply #6 on: 23 March 2017, 22:13:34 »
Coldfusionstorm Basically on my eye you don't fully understand the situation.
Most problems in the past in this area which showed up publicly were related with some dumb "feature on windows" which is attempting to "improve" filenames during saving or changing the names of some files. Very popular problem looks like e.g:
you are trying to change the file name for "mychoosedname.png" and in some magical way after putting the name and pushing the enter key you get a result like "mychoosedname.PNG".
I don't care is it an odd feature or is it a bug in windows but this is the main problem.

If this "magical changing" will be someday somehow stopped then your message will be around valid, because it will be something close to "linux feature vs windows feature", ...but for today it is mostly about some bugs somewhere on windows/windows apps side.
« Last Edit: 23 March 2017, 22:32:00 by filux »

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: [8]Case sensitivity for windows too
« Reply #7 on: 24 March 2017, 17:32:12 »
@ Titi , i did not have a bad day(and im sorry if you felt i was rude to you, that was not intended in that case), i dislike how you feel windows is at fault.
1. this is how windows does filenames, it doesn't care about case sensitivity. That's a fact whether you like it or not.
2.Yes, this is obvious and i would like you gave me a bit more credit than thinking this was not the case.
3.Yes and it's awesome some day when windows goes full retard with subscriptions and cloud and what else they try to figure out (soul consumption clause anyone?), (and they will). I have a better place to go thanks to awesome people like you!  :thumbup:

@Filux
i have never had problems with windows file extensions from my point of view Linux is worse in this regard because im used to non-case sensitivity, and your point which you rather rude pointed out, about bugs with file extensions are moot. If Linux was non-case sensitive this wouldn't be a problem regardless if windows bug or not made file extensions with case or not.

And on a final note, You sounded very rude and assumed i didn't understand the problem, then proceeded to rack down on my OS of choice forcing your own belief that a bug or feature is "dumb" and "improve" with quotations.

Do not talk down to me again.. thank you.

edit: i almost forgot the most impotant thing.

@Titi, i think you are right tho. I don't really like it, it feels(for me) like a ugly workaround, But it will be a great help for modders who are on windows so they suddenly don't have users on Linux for which the mod doesn't work for.
WiP Game developer.
I do danish translations.
"i break stuff"

filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
Re: [8]Case sensitivity for windows too
« Reply #8 on: 24 March 2017, 20:10:41 »
Well, sorry that I assumed that you just didn't know that somewhere on windows something is happening against your will.
Now I know that if it is windows then doing anything against your will is ok for you ...because it is windows. I know this type of people just didn't recognized you as one of them. Sorry once again.

For me personally if any program/app on any operating system is doing anything against your will then only the final results of this behavior will tell you what is it exactly. Basic options to choose from are:
- bug,
- malware,
- virus.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: [8]Case sensitivity for windows too
« Reply #9 on: 26 March 2017, 04:23:09 »
Man, some of you guys are taking this OS war stuff waaaay too seriously. Let's chill a little.

Even myself, as a hardened Linux fangirl, I got nothing against Windows and think its approach has some merits. And for context, I've done software dev on all three major OS families for a significant length of time.
Let's not pretend Windows is the only platform that is case insensitive. Arguably most things that aren't programming languages are, really. And plenty of programming languages are (eg, SQL). Many things related to the web are case insensitive. Eg, domain names are. OS X is the other platform that's case insensitive (well, by default at least, when using the HFS filesystem configured that way).

I also see some misinformation in this thread. There should not be any "magical way" to name a file "example.png" and it would actually end up "example.PNG" short of a program purposefully doing that. And that would happen just the same on Linux. And I've never seen a program do that. Simply some programs default to making the extension uppercase for a weird reason. Most famously the Windows snipping tool does this. That'll only happen if you don't specify an extension.

I find it hilarious that anyone might act like Windows is the only OS that does things "against your will". Most pieces of software have some feature at some point that doesn't have an easy way to disable that you don't like. For example, Firefox is a favourite program of mine. Yet they constantly introduce and remove features with no choice to users. Remember when Pocket got integrated? Or what about when Chrome stopped allowing extensions that weren't from their store. And heck, iOS has had that idea of a walled garden forever.

But anyway, can we chill the OS war a bit? I mean, obvious Linux is the best (ok, I'm biased), but there's nothing wrong with using other OSes, too (I actually mostly use Windows and my last job was all over the Microsoft stack, anyway).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: [8]Case sensitivity for windows too
« Reply #10 on: 26 March 2017, 15:41:48 »
i don't care which OS people use.

I care that people bash on things based on their own bias. And then talk down to other people.

Normal is a overrated definition anyways ;)
WiP Game developer.
I do danish translations.
"i break stuff"

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 474
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
Re: [8]Case sensitivity for windows too
« Reply #11 on: 28 March 2017, 07:11:06 »
I certainly don't feel I'm in any position to "bash" an OS, or even to have anything against proprietary software such as MS Windows. I made a living for 7 years because of proprietary software when I worked for a software duplication and packaging company. Many other people have supported themselves and their families because of proprietary software.

I like this quote:

You guys have an awfully one-sided view of freedom. :| I love open source software, but freedom is a principle, not a buzzword to justify your feelings. Liberty also includes the right to release your program and your code however you see fit.

Undoing the thread hijack...

I find that people generally adhere mostly to their principles when it's convenient. MG devs ensure that MG runs on Windows. In a sense, it would be "inconvenient" not to do that, because then MG wouldn't be available to the huge percentage of people who use Windows.

Many current OSS users, myself included, only got into computers because they started using PC's with prop. software. So... I am in really no position to complain about how people choose to distribute their software, how it's developed, or what freedoms they exercise to determine how they want to earn their money.

A father or mother who must support 5 children isn't going to care about the license of software they use, if it's the best method to support and feed his or her family. So.. the debate, as Omega wisely suggested, is best chilled.