GNOME Bugzilla – Bug 696451
Copy of folder containing a dot ("."): "(Copy)" string appended directly after dot in middle of name
Last modified: 2017-11-02 15:44:43 UTC
Steps to reproduce: 1. Create a folder named "Gnome 3.8" 2. Press Ctrl+C 3. Press Ctrl+V 4. Look at the folders, "Gnome 3.(Copy)8" has just been created... Expected. 4. "Gnome 3.8 (Copy)" was expected.
I can confirm this bug, with one difference: I get the string directly before the dot, not directly after. For the provided example, I get "Gnome 3 (copy).8", not "Gnome 3.(Copy)8".
Thinking further about this, whatever is after the dot, it may be a file format extension. Nautilus cannot suffix" (Copy)" after the dot because it would break the extension. Even for the provided file name example (Gnome 3.8), a web search for "file extension .8" reveals that ".8" has been used as a file format extension.
(In reply to comment #2) > Thinking further about this, whatever is after the dot, it may be a file format > extension. Nautilus cannot suffix" (Copy)" after the dot because it would break > the extension. > > Even for the provided file name example (Gnome 3.8), a web search for "file > extension .8" reveals that ".8" has been used as a file format extension. Folder usually do not have any file extensions. Thus in the folder case the (Copy) should be at the end.
*** Bug 706895 has been marked as a duplicate of this bug. ***
*** Bug 724572 has been marked as a duplicate of this bug. ***
Issue still on Nautilus 3.12.2 An exception to folders would be great, as folders don't use extensions. Or is there a use case that I'm missing?
Created attachment 358420 [details] [review] file-operations: ignore extensions when duplicating folders If a file named "foo.bar" is duplicated, the copy is named "foo (copy).bar", keeping the extension at the end. However, this is applying to folders too, where we don't need to worry about keeping extesions at the end. The result is unexpected. Therefore, ignore extension if the duplicating item is a folder, except if the folder already has a copy tag before a dot, such as "dir (copy).dir".
Created attachment 358455 [details] [review] file-operations: ignore extensions when duplicating folders If a file named "foo.bar" is duplicated, the copy is named "foo (copy).bar", keeping the extension at the end. However, this is applying to folders too, where we don't need to worry about keeping extesions at the end. The result is unexpected. Therefore, ignore extension if the duplicating item is a folder, except if the folder already has a copy tag before a dot, such as "dir (copy).dir".
Review of attachment 358455 [details] [review]: LGTM. The tests are a nice addition, too.
Attachment 358455 [details] pushed as 2b2031d - file-operations: ignore extensions when duplicating folders