Lazarus
Programming => General => Topic started by: Borneq on December 07, 2019, 10:55:41 pm
-
I am comparing paths using CompareText or CompareStr depend if is case sensitive filesystem.
Worse solution: what are conditionals for Windows, Linux and other case-sensitive, insensitive systems?
But it is not quite good: in Linux can I read Fat32 or NTFS, while is case insensitive, better would be ask for directory, for example '.' and determine sensitivity.
-
Afaik FPC does not deal with this on a file system basis, only with global variables FileNameCaseSensitive and FileNameCasePreserving
-
Write to temp files, one with Upper case the other as lower.. See if you get a file error when writing the second :)
-
Or the other way round:
Write filename "MyFile"
Check if " MYFILE" exists.
-
I am comparing paths using CompareText or CompareStr depend if is case sensitive filesystem.
Worse solution: what are conditionals for Windows, Linux and other case-sensitive, insensitive systems?
But it is not quite good: in Linux can I read Fat32 or NTFS, while is case insensitive, better would be ask for directory, for example '.' and determine sensitivity.
Well, things have gotten even more complicated regarding that, because NTFS nowadays (Windows 10) supports per directory case sensitivity (for WSL) and Ext4 recently gained support for per directory case insensitivity...
-
I am comparing paths using CompareText or CompareStr depend if is case sensitive filesystem.
Worse solution: what are conditionals for Windows, Linux and other case-sensitive, insensitive systems?
But it is not quite good: in Linux can I read Fat32 or NTFS, while is case insensitive, better would be ask for directory, for example '.' and determine sensitivity.
What is your actual use case?
Why not always check using the case sensitive function?
-ASB