4 ms·
Keep that stuff away from my filesystem is my first thought on the matter! Having had a fair amount of experience dealing with case sensitive, case insensitive
by nickcw 6y ago
Keep that stuff away from my filesystem is my first thought on the matter!
Having had a fair amount of experience dealing with case sensitive, case insensitive and HFS+ (argh!) file systems in rclone, all I can say is that it is really hard and much better left to user space. Rclone does syncing between diverse systems with different ideas about case sensitivity and normalization when matching up the the source file with the destination file.
I'm not even sure that I agree with normalizing the UTF-8 strings - some users really care that they have two files which look identical but have different encoding, for example files with é and é which evaluate to 0x65+0x301 and 0xE9 respectively but look identical.
I might possibly go for filenames having to be valid UTF-8 - that would at least be consistent with Windows and macOS.
PS I haven't found a way of discovering whether a file system is case insensitive or case sensitive without creating a file - is it possible?
- CUViper 6y agoFor discovery, you could readdir, verify no case-sensitive overlaps, then stat a filename with changed case. Maybe compare inodes and number of hard links too if the changed name does succeed.
- cyphar 6y ago> I haven't found a way of discovering whether a file system is case insensitive or case sensitive without creating a file - is it possible? You should be able to do ioctl(EXT4_IOC_GETFLAGS) on the directory and check if EXT4_CASEFOLD_FL is set. I'm not sure if this flag is applied recursively to child dentries (though I would assume it is).