Author Topic: GSX / File Case Issue  (Read 2755 times)

AAN1718A

  • Newbie
  • *
  • Posts: 6
GSX / File Case Issue
« on: January 02, 2016, 08:20:10 pm »
Support,

I am having some difficulty understanding why GSX isn't active when I load FSX. Once installed it will run a few times then on another occasion it will not. I have narrowed it down to a file case problem and was wondering if you can confirm that.

I have written a program called CaseFile years ago to normalize my files and folders for readability purposes. Since the days of DOS the file explorer in Modern OS's is not able to be adjusted to display just upper, lower or proper case files, unless you physically rename the files (not like in the DOS days where you can use the DIRCMD switch).

In any event, If I install GSX into FSX it works fine, no problems. Once I run my utility GSX is no longer active until I re-install it. I wanted to check with you and your programmers if indeed you are checking and manipulating your software with case sensitive strings, because once I rename the files within the GSX folder, it will not be available for me in FSX until I re-install the software again.

If that is the case, that is not a recommended programming practice to hardcode strings and/or have be a certain case because anyone can rename a file to adjust the case and it can break the program.
I do realize that most likely 90% of people don't have a habit of renaming files on their computer just to change the case, but I did want to point out that seems to be the issue I am having and wanted to know if you can confirm that changing the case of the GSX folder to ProperCase folders and lowercase filenames does indeed break the program.

I can of course omit the folder and everything will work as it's supposed to. Just wanted to find out if that what is causing my setback.
Thank you again for your support.

Current Specs: Windows 7 x64 64GB RAM, 512SSD M.2 GTX980 w/FSX SP2 with ORBX Global, EditVoicePack XL, MyTraffic 6.0 (no aircraft installed yet).

Thanks again.

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 51452
    • VIRTUALI Sagl
Re: GSX / File Case Issue
« Reply #1 on: January 03, 2016, 11:00:01 am »
I wanted to check with you and your programmers if indeed you are checking and manipulating your software with case sensitive strings, because once I rename the files within the GSX folder, it will not be available for me in FSX until I re-install the software again.

If that is the case, that is not a recommended programming practice to hardcode strings and/or have be a certain case because anyone can rename a file to adjust the case and it can break the program.

We do not hard-code strings when case might matter.

HOWEVER, Couatl is a Python interpreter, and there many places when files are *imported* using the standard "import" Python command, which allows a python module to "see" objects declared in another module. This is not obviously anything WE coded, but it's part of the standard Python language.

Since Python is a cross-platform language, its script syntax AND the "import" statement ARE case-sensitive. By default, it's case-sensitive on Windows too, to keep compatibility across different platforms. For example, if someone did something like this (not very smart, but still legal in Python):

from myFile import myFunction1
from MyFile import myFunction2
from MYFILE import myFunction3

It WILL work on Unix and Mac too, but it would fail on Windows IF Python for Windows was made to default to case-insensitive imports so, in order not to break compatibility with existing programs written on case-sensitive OS, Python use case-sensitive imports on Windows too.

HOWEVER, there's an environment variable you can try setting, which can override this behaviour:

PYTHONCASEOK

If you SET this to any value ( 1, for example ), in the System settings, as a Global environment variable, it SHOULD force the Python interpreter to do case-insensitive imports.

You can try this, but I cannot guaranteed it will work, because there might be other places where that variable is not used by Python which are still case-sensitive, maybe not related to the "import" statement, which were the first thing I thought of when you described the problem.

Quote
I do realize that most likely 90% of people don't have a habit of renaming files on their computer just to change the case

Maybe 99.99% it's a more accurate figure.

In fact, if you had OTHER products (even non-flightsim related) that are made in Python, or use Python for scripting, like Blender, or some games like Civilization, etc. changing case MIGHT break them for the same reason, unless you set that variable.

I suggest excluding the fsdreamteam folder from your rename job. It's much safer.

AAN1718A

  • Newbie
  • *
  • Posts: 6
Re: GSX / File Case Issue
« Reply #2 on: January 04, 2016, 01:56:53 am »
lol, agreed on the 99 percentile.

There are other programs which would be affected by changing the case, which is why I never run this utility on any root drive and the utility will not rename system files anyway.
I will try the environment variable suggestion to see if that works,

In either case, it will work if I leave it alone. I do understand about the cross-platform inconsistences sometimes, Microsoft is also not to case-insensitive software.

Thanks again for your insight.