Path: ...!weretis.net!feeder8.news.weretis.net!news.nntp4.net!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail From: Richard Kettlewell Newsgroups: comp.os.linux.misc,comp.os.linux.advocacy Subject: Re: Case Insensitive File Systems -- Torvalds Hates Them Date: Sat, 10 May 2025 11:06:01 +0100 Organization: terraraq NNTP server Message-ID: References: <20250428080014.0000347f@gmail.com> <20250428111242.00007426@gmail.com> <20250429201119.736dc05c@blackbird.dehmel-lan.de> <20250430210913.7e2f0782@blackbird.dehmel-lan.de> <6815278d$0$12946$426a34cc@news.free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6"; logging-data="175074"; mail-complaints-to="usenet@innmantic.terraraq.uk" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cancel-Lock: sha1:NF76zXfhevGAQOI8A53waApbYX4= X-Face: h[Hh-7npe<v9!1Z&W?r\c.!4DXH5PWpga"ha +r0NzP?vnz:e/knOY)PI- X-Boydie: NO Bytes: 4141 Lines: 62 The Natural Philosopher writes: > On 10/05/2025 09:38, Richard Kettlewell wrote: >> The Natural Philosopher writes: >>> On 03/05/2025 13:09, Chris Ahlstrom wrote: >>>> Lawrence D'Oliveiro wrote this post while blinking in Morse code: >>>>> ldo@theon:caseinsens-try> touch try.dat >>>>> ldo@theon:caseinsens-try> ls -l >>>>> total 0 >>>>> -rw-r--r-- 1 ldo users 0 May 3 11:57 try.dat >>>>> ldo@theon:caseinsens-try> mv try.dat TRY.DAT >>>>> mv: 'try.dat' and 'TRY.DAT' are the same file >>>>> >>>>> I guess Linux isn’t any better ... >>>> It works on my Linux box (Debian Sid). >>>> Heh heh: >>>> >>> And mine (Mint 22) >> I would guess that you’re doing the test on a case-dependent >> filesystem? With vfat and 9p (to NTFS, in WSL) the behavior is as >> Lawrence describes. >> > Lawrence said it was a feature of Linux, not of the file system in use The context was case-insensitive filesystems, but the logic being applied is indeed independent of filesystem; it just leads to different results in different types of filesystem. (Strictly, it’s a feature of GNU coreutils, but apart from that I think his point stands.) First, the Linux rename() syscall has no trouble with renames to the ‘same’ name (with or without a case change and in both case-insensitive and case-sensitive filesystems). So in that sense Linux copes with the situation just fine. In fact so does Windows, both via explorer and ren; I don’t know what behavior the poster before Lawrence was experiencing but there doesn’t seem to be a problem today. However, we’re not using (just) rename() here. coreutils’s mv does quite a lot of work for a superficially simple rename but the relevant part here is that it explicitly checks whether source and destination are the same file and refuses to rename in that situation. The situation also arises if you use hard links: $ touch a $ ln a b $ mv a b mv: 'a' and 'b' are the same file So that’s the sense in which it’s a feature of Linux (strictly: of coreutils). The behavior in case-insensitive filesystems follows, since in a case-insensitive filesystem, try.dat and TRY.DAT are two names for the same file. IMO that’s a bug in mv: you should be able to change letter case in case-insensitive filesystems using just mv. -- https://www.greenend.org.uk/rjk/