After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696451 - Copy of folder containing a dot ("."): "(Copy)" string appended directly after dot in middle of name
Copy of folder containing a dot ("."): "(Copy)" string appended directly afte...
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Cut Copy Paste Undo
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 706895 724572 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-03-23 11:00 UTC by Felix Möller
Modified: 2017-11-02 15:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file-operations: ignore extensions when duplicating folders (14.02 KB, patch)
2017-08-25 15:50 UTC, António Fernandes
none Details | Review
file-operations: ignore extensions when duplicating folders (14.02 KB, patch)
2017-08-25 23:19 UTC, António Fernandes
committed Details | Review

Description Felix Möller 2013-03-23 11:00:55 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.
Comment 1 António Fernandes 2013-03-24 23:15:04 UTC
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".
Comment 2 António Fernandes 2013-04-22 13:50:02 UTC
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.
Comment 3 Felix Möller 2013-04-22 19:06:39 UTC
(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.
Comment 4 António Fernandes 2013-08-27 14:25:10 UTC
*** Bug 706895 has been marked as a duplicate of this bug. ***
Comment 5 António Fernandes 2014-02-17 20:37:20 UTC
*** Bug 724572 has been marked as a duplicate of this bug. ***
Comment 6 Eddy Castillo 2014-08-13 19:33:09 UTC
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?
Comment 7 António Fernandes 2017-08-25 15:50:58 UTC
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".
Comment 8 António Fernandes 2017-08-25 23:19:56 UTC
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".
Comment 9 Ernestas Kulik 2017-08-28 07:56:12 UTC
Review of attachment 358455 [details] [review]:

LGTM. The tests are a nice addition, too.
Comment 10 António Fernandes 2017-11-02 15:44:39 UTC
Attachment 358455 [details] pushed as 2b2031d - file-operations: ignore extensions when duplicating folders