Embed Notice
HTML Code
Corresponding Notice
- Embed this notice@aral The kernel, Linux usually doesn't even comprehend what case is - each filesystem driver implements a data structure for each file that includes a a field for the "file name" (filesystem drivers don't even need to be a Linux driver, they can be a FUSE driver that doesn't really care about what kernel you use a long as it can access a certain interface).
If you run mv main.layout.js --> Main.layout.js, GNU mv will call rename("path/to/main.layout.js", "path/to/Main.layout.js"), which will instruct glibc to call the correct SYSCALL to Linux or to Hurd.
git on running `git commit` will run the appropriate lstat(), openndir() and readdir() glibc commands and compare the current filesystem layout to its internal data structure of the last commit.
macOS's libc also happens to implement similar functions, except those functions are so broken it's not possible to do a case-sensitive match
As always, that should have been; "On GNU/Linux, if you rename a file" or; "On LiGNUx if you rename a file" or to refer to both GNU/Linux and GNU/Hurd (both have the same behavior) in a shorter to type way; "On GNU, if you rename a file".
Computers are case sensitive (although the option for a case-insensitive *search* has its usages) and so no matter what you try, "case insensitive filesystems" always end up case sensitive in corner cases.
>Linux must have to examine file structure to estimate file type
Linux has no concept of file structures - for every file contents, all it sees is a block of bytes.
The `file` command, which has nothing to do with Linux, uses magic definitions in /usr/share/misc/magic /usr/share/misc/magic.mgc to guess filetypes, which is very reliable for files that use magic headers.
Some software written for GNU does use file extensions like .conf to mark configuration files, but determining that a `.conf` extensioned files is actually a configuration file is an act of parsing.