Liste des Groupes | Revenir à col advocacy |
The Natural Philosopher <tnp@invalid.invalid> writes:
>On 10/05/2025 09:38, Richard Kettlewell wrote:>The Natural Philosopher <tnp@invalid.invalid> writes:Lawrence said it was a feature of Linux, not of the file system in useOn 03/05/2025 13:09, Chris Ahlstrom wrote:I would guess that you’re doing the test on a case-dependentLawrence D'Oliveiro wrote this post while blinking in Morse code:And mine (Mint 22)ldo@theon:caseinsens-try> touch try.datIt works on my Linux box (Debian Sid).
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 ...
Heh heh:
>
filesystem? With vfat and 9p (to NTFS, in WSL) the behavior is as
Lawrence describes.
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.
Les messages affichés proviennent d'usenet.