Bug 322572

Summary: Renaming a file from "a" to "A" in a case-insensitive file system fails
Product: [Unmaintained] kio Reporter: Pascal d'Hermilly <pascal>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED DUPLICATE    
Severity: normal CC: adawit, frank78ac, nate
Priority: NOR    
Version First Reported In: 4.10.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Pascal d'Hermilly 2013-07-19 13:20:26 UTC
when renaming a file "a" to "A" in a case-insensitive file system dolphin comes up with a "File already exists" dialog. If you click overwrite the same dialog just appears again.

E.g. if you mount a windows network fileshare and try to rename a file "a" to "A" 

Reproducible: Always
Comment 1 Dawit Alemayehu 2013-07-20 03:32:42 UTC
(In reply to comment #0)
> when renaming a file "a" to "A" in a case-insensitive file system dolphin
> comes up with a "File already exists" dialog. If you click overwrite the
> same dialog just appears again.
> 
> E.g. if you mount a windows network fileshare and try to rename a file "a"
> to "A" 

ehh... how can a windows network file share possible be case-insensitive? Anyhow, can you successfully rename the file from the command line? This is only a bug if you can do that. Otherwise, this is not a bug at all. I have never ever known Windows filesystems to be case-insensitive.
Comment 2 Pascal d'Hermilly 2013-07-25 20:48:14 UTC
Will do the CLI test on monday, until then from the SAMBA documentation:
"No Windows or DOS system supports case-sensitive filename"
and 
"By default, Samba 3.0 has the same semantics as a Windows NT server, in that it is case insensitive but case preserving."
Comment 3 Pascal d'Hermilly 2013-07-29 10:25:07 UTC
Just did test with a windows share - and experienced some strange behaviour. just using mv returns error that it is the same file. The first time I used "mv -f" it worked. After that "mv -f" returns the same error as "mv".
$ mv A.txt a.txt
mv: ‘A.txt’ and ‘a.txt’ are the same file
$ mv -f A.txt a.txt
$ mv -f a.txt A.txt
mv: ‘a.txt’ and ‘A.txt’ are the same file

Are there any CLI tools that actually does a filename change rather than a move?
Comment 4 Pascal d'Hermilly 2013-07-29 10:37:58 UTC
doing the following works like a charm and changes the case of the file.
$  mv a.txt a.txt.tmp && mv a.txt.tmp A.txt

only thing is it is not an atomic operation... but, it's better than no operation
Comment 5 Dawit Alemayehu 2013-08-17 15:21:38 UTC
(In reply to comment #4)
> doing the following works like a charm and changes the case of the file.
> $  mv a.txt a.txt.tmp && mv a.txt.tmp A.txt
> 
> only thing is it is not an atomic operation... but, it's better than no
> operation

That is a completely different operation than renaming the file. Copying the file to a different name and renaming it back should also work from the GUI as well. It should ask you whether you want to overwrite it or not.
Comment 6 Pascal d'Hermilly 2013-08-18 21:40:22 UTC
@dawit: Please reflect over comment 3 instead.
Comment 7 Dawit Alemayehu 2013-08-18 22:59:26 UTC
(In reply to comment #6)
> @dawit: Please reflect over comment 3 instead.

Well things are probably dependent on the mount options you used to mount the windows volume. From the mount.cifs documentation, if you used the "nocase" option, the volume will be mounted case-insensitive which means it will give you the error you got in comment #3. I dunno why mv -f works the first time you try it, but fails on subsequent attempts. It should be consistent and fail all the time if the mounted volume is case-insensitive and off the top of my head I know of no other tools  you can use to change filename.
Comment 8 Nate Graham 2018-04-25 21:57:05 UTC

*** This bug has been marked as a duplicate of bug 197276 ***