GNOME Bugzilla – Bug 306341
Nautilus creates a tarfile with wrong extension.
Last modified: 2006-09-14 19:58:16 UTC
1.Browse to a folder containing a tar.gz archive (E.g. mydata.tar.gz) 2.Create a duplicate of this archive file. (Select the archive file; Edit -> Duplicate) Observation and bug -> Nautilus creates a duplicate file named "mydata.tar (copy).gz". When a user tries to extract from this file, file-roller does not completely restore the folder contents, since the intermediate archive file generated is named "mydata.tar (copy).gz" Expected -> The duplicate file must probably be named as "mydata (copy).tar.gz" [The word "copy" preceding the ".tar" extension
I'll be looking into this issue and giving a patch, Thanks.
Created attachment 47189 [details] [review] Attached patch fixes the bug The patch changes strrchr() function in parse_previous_duplicate_name to strchr() so that the '(copy)' gets added before the first '.' in the file name when a duplicate copy is created.
Thanks for your bug report and your patch! It was indeed decided that it is sane to assume that the file extension begins after the first dot in a filename.
Also see bug 302044.
commited.
*** Bug 46455 has been marked as a duplicate of this bug. ***
> It was indeed decided that it is sane to assume that the file > extension begins after the first dot in a filename. I don't know who decided what, but such a decision would not by any stretch of the imagination be sane. There are extremely many files named "My.First.Song.mp3" or somesuch, often just to not have problems with various systems that have issues with spaces (e.g. "%20" and "+" in URLs). Since file extension databases can be outdated, or simply wrong, the only even remotely sane way of handling the issue would be to put the "copy" thing first, e.g ."Copy of My.First.Song.mp3". This breaks ordering (well, kinda, unless you indeed want all copies to be grouped together when ordering), but that's the least evil thing to do unless you want to ask the user all the time.