Author Topic: Suggestion: Support mixed case files on case insensitive file systems  (Read 4525 times)

Offline dfatcb

  • Multiple posting newcomer
  • *
  • Posts: 67
Hi,

I have an issue where VS2017 renames files to the case that the solutions explorer has.  So originally having mixed case, prior to porting to Linux and moving all files to lower case, there are hundreds of projects in that state.   In code::blocks I share the drive via a mount point to the NTFS partition.   The files loaded in code::blocks are lower cases (in some cases mixed case), but once VS2017 renames a file it throws off code::blocks building.  Sometimes the symptom is that it keeps rebuilding a project that is already up to date, however, the bigger problem is that in some other cases it doesn't detect the changes and doesn't build the updated files throwing everything out of sync.   Can you support mixed case files on file systems like NTFS.

Also an easy want to update on things like Debian Jessie.

Also I'm talking about using code::blocks on linux, not windows version.

TIA!!

« Last Edit: February 11, 2019, 02:00:41 am by dfatcb »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Suggestion: Support mixed case files on case insensitive file systems
« Reply #1 on: February 11, 2019, 02:37:23 am »
What?
You are using codeblocks on linux to compile a VS2017 project stored on a shared network NTFS drive?
Now you rename your file on windows to mixed case and it won't compile in codeblocks? Do you update the project file?
Do you know that NTFS on windows is sort of case insensitive but linux is case sensitive? So on windows the files are the same but on linux not?
Quote
throws off code::blocks building
what does this mean?

Quote
Can you support mixed case files on file systems like NTFS
probably not because it is a driver thing and not a codeblocks thing...

Quote
Also an easy want to update on things like Debian Jessie.
update what? Codeblocks? Complain at the maintainer there... Or build it by yourself, it is really easy...


Offline dfatcb

  • Multiple posting newcomer
  • *
  • Posts: 67
Re: Suggestion: Support mixed case files on case insensitive file systems
« Reply #2 on: February 19, 2019, 12:51:02 am »
The source code is shared.

IIRC, You can query (ioctl) the mount point and it will return if the file system is case sensitive or not (or at least the type and know).


an example of the "throws off" is in the next sentence.

By mixed case I mean "file1" is the same as "File1" so if the project has "file1" it should be able to handle "File1".


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Suggestion: Support mixed case files on case insensitive file systems
« Reply #3 on: February 19, 2019, 01:51:57 am »
I suggest you learn how to fix it on your end. You might ask an CB Developer if the CB Scripting could be used to fix this issue.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Suggestion: Support mixed case files on case insensitive file systems
« Reply #4 on: February 19, 2019, 10:49:17 am »
I still do not understand what you are doing...

Quote
an example of the "throws off" is in the next sentence.

By mixed case I mean "file1" is the same as "File1" so if the project has "file1" it should be able to handle "File1".
This still does not tell me how the error manifests in codeblocks... Can you not open the file? Do you get compiler errors? Does codeblocks crash? Be more descriptive in your answers please...

The thing with case sensitive and case insensitive is: Codeblocks does not alter the path (for example we do not call path.toUpperCase() to convert them to all upper case). We simply call wxWidgets functions with the full path we get from the user or other wxWidgets functions. And wxWidgets probably uses the file system functions provided by the operating system. So if the NTFS driver for linux does not support mixed case we can not support it.
for example https://serverfault.com/questions/901855/ntfs-3g-ignore-case


Have you tried to copy the project to a unix file system? Does the same thing happen? Have you tried other programs? do they work with mixed case? Can you provide more examples, witht full paths and describing the whole situation in more detail?

Offline blauzahn

  • Almost regular
  • **
  • Posts: 153
Re: Suggestion: Support mixed case files on case insensitive file systems
« Reply #5 on: February 19, 2019, 07:34:08 pm »
Quote
...once VS2017 renames a file it throws off code::blocks building.  ...
So, IMHO, it sounds like it is VS who is screwing up here. Then you should ask their developers to fix it.

Quote
...if the project has "file1" it should be able to handle "File1".
I would vote against that. If feels like another potential source of problems. Not worth the trouble.

We use a shared codebase north of 2.5k files with Windows VS as well as with Linux CB. And we
do have upper- as well as lowercase letters in our filenames. The only time a compilation might
break is when we ourselves made an error while renaming.
 
In case of your many exisiting projects you might consider converting them once (again) and from
then on maintain some naming discipline.

Do the files cb creates while compiling and linking reside on NTFS as well or on a case sensitive linux file system?

Btw: You do know the plugin "find broken files in project", don't you?

Offline dfatcb

  • Multiple posting newcomer
  • *
  • Posts: 67
Re: Suggestion: Support mixed case files on case insensitive file systems
« Reply #6 on: February 25, 2019, 08:02:40 am »
This still does not tell me how the error manifests in codeblocks... Can you not open the file? Do you get compiler errors? Does codeblocks crash? Be more descriptive in your answers please...

"throws off code::blocks building.  Sometimes the symptom is that it keeps rebuilding a project that is already up to date, however, the bigger problem is that in some other cases it doesn't detect the changes and doesn't build the updated files throwing everything out of sync."

I'm talking about the "build" (ability to detect changes and build the files that need to be rebuilt).  It can access the files fine, but the build doesn't work right when the name on the disk is different than the name in the project.  e.g. File1 vs file1









Offline blauzahn

  • Almost regular
  • **
  • Posts: 153
Re: Suggestion: Support mixed case files on case insensitive file systems
« Reply #7 on: February 25, 2019, 12:53:15 pm »
Quote
[...] it keeps rebuilding a project that is already up to date,

Aside vom the file naming issue you have.
This can also be a hint that you maybe have cyclic dependencies in your project.

Offline dfatcb

  • Multiple posting newcomer
  • *
  • Posts: 67
Re: Suggestion: Support mixed case files on case insensitive file systems
« Reply #8 on: April 06, 2019, 08:22:33 am »
I just noticed something today.  When the renamed file is a .cpp file type, it just always rebuilds.  If it's a .hpp file type, it misses the changes.

I found a file with case changed to MAIN.CPP and was always rebuilding, renamed to main.cpp and then all targets up to date.  Then I found SUPPORT.HPP was misnamed as well, I renamed to support.hpp and then the build found 3 modules to build.