Sujet : Re: Case Insensitive File Systems -- Torvalds Hates Them
De : rich (at) *nospam* example.invalid (Rich)
Groupes : comp.os.linux.miscDate : 06. May 2025, 02:31:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vvbook$1oubc$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Computer Nerd Kev <
not@telling.you.invalid> wrote:
Rich <rich@example.invalid> wrote:
Computer Nerd Kev <not@telling.you.invalid> wrote:
I question the wisdom of Torvalds on this topic since he allowed
ext filesystems to have an even greater evil than either of those:
newlines in file names! Imagine if the average joe were exposed
to that capability - we'd have multi-paragraph file names to deal
with all over the place.
Torvalds did not "allow newlines". Unix filesystems, long before Linux
ever existed, have only disallowed two characters in filenames:
ASCII null (because C strings are ASCII null terminated)
The forward slash (/) (because forward slash is used as the directory
separator).
Torvalds was simply following standard Unix protocol (in order to be
compatible with Unix standards) for what was "allowed" to be in a
filename.
Perhaps, but since he wasn't using existing UNIX filesystems and
using a custom one instead, it seems to me like he had a choice.
And since all existing Unix filesystems were case sensitive, then
building his new Unix filesystem the same way as all the others would
have made perfect sense.
Note that the case sensitivity in Unix filesystems was not, per se., a
designed in decision, it comes about because the kernel treats
filenames as simply a raw C null terminated string (i.e., as an array
of length N of 8-bit bytes), and "filename comparison" is done via a
function that performs what memcmp() from libc performs, raw byte
comparisons. When you perform string comparisons by comparing the raw
bytes, "case sensitivity" is the user visible outcome.
After all you can still use FAT or NTFS on Linux even though they
have more disallowed filename characters.
No, you can access FAT or NTFS, but you can not use them as Linux
filesystems. Try using FAT or NTFS as the root FS or as the /home FS
and things won't work out well (if at all). Neither has the required
attributes (primarily the permissions) that are expected for use as a
Unix filesystem.
It could have been the same with ext* forbidding newlines (also tmpfs
etc.). Then you'd only have to worry about handling newlines in the
rare case of reading from some non-Linux filesystems like UFS.
Could ext* have forbade newlines? Yes. But that would have gone
against years of Unix tradition at the time had it done so. Since
Linux began as a "clone of Unix" it was only natural for it to inherit
Unix traditions as to filenames (any byte value other than ASCII NULL
and ASCII forward slash being allowed).