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 64668 - Copy-n-pasting not-existing file to overwrite file on remote dir only removes remote file
Copy-n-pasting not-existing file to overwrite file on remote dir only removes...
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: File and Folder Operations
2.9.x
Other All
: Normal major
: future
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2001-11-16 00:19 UTC by Jonas De Vuyst
Modified: 2015-06-17 13:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jonas De Vuyst 2001-11-16 00:19:49 UTC
When pasting a not existing file to a remote location where a file using
the same name already exists, brings up the replace-all/replace/cancel
dialog and deletes the remote file on choosing replace.

To reproduce:
- Make a file called "x" on the desktop
- Make a file called "x" on a remote location (I only tried using FTP)
- Copy the "x" file on the desktop to the clipboard
- Go to the console and remove the "x" file on the desktop
- Paste files onto the remote location

Expected behaviour:
Paste Files menu item should have been disabled, an error dialog should
have been shown or even nothing should have happened. Note that when the
same thing is done using only local locations, the copy files dialog shows
up to copy 0 files.

Why this bug can effect average computer users too:
I found this bug when I cut-n-pasted an index.html file from my home dir to
a remote FTP location and afterwards wanted to paste the file again on a
different FTP site. Initially I didn't notice I lost anything (which is why
this bug is so bad).
Comment 1 Darin Adler 2001-11-16 00:36:05 UTC
It does seem important to fix this.

But the best way to avoid problems like this is to install FAM.
Comment 2 Jonas De Vuyst 2001-11-16 00:51:53 UTC
Forgive my ignorance but wouldn't after installing FAM the bug still
be there when doing what I described above, but with the "x" file on
the desktop being an "x" file on some other FTP directory?
Comment 3 Darin Adler 2001-11-16 00:54:32 UTC
Probably, yes.

In fact, in the FTP case, you can still run into trouble if someone
deletes the file while you are copying it. I guess in that case the
best we can do is to make sure we report the error.
Comment 4 John Fleck 2002-01-26 04:15:19 UTC
Adding GNOME2 keyword.
Comment 5 Luis Villa 2002-02-25 22:09:39 UTC
Major, because of the data loss involved.
Comment 6 Joao Victor 2004-09-24 03:27:06 UTC
This bug is almost 3 years old, has it been fixed? I suggest increasing it's
priority, because this is a serious bug.
Comment 7 Michael Henson 2004-10-05 01:11:16 UTC
Just tested between my local drive and an sftp drive, is still reproducible.
Comment 8 Kjartan Maraas 2005-01-03 15:37:32 UTC
Bumping version...
Comment 9 Sebastien Bacher 2005-01-22 17:08:50 UTC
still here with 2.9
Comment 10 Jonas De Vuyst 2005-12-24 14:56:59 UTC
In bug #324930 I described a second scenario that triggers this bug. I reproduce it here for your convenience:

 * Create a file "A" on a FAT drive;
 * Create a symlink "A" on your desktop;
 * Drag the symlink to the FAT drive;
 => A dialog will pop up asking if "A" should be overwritten;
 * Choose "overwrite";
 => File "A" on the FAT drive is deleted & copying the symlink fails.

This is annoying when you want to overwrite "A" with a newer version of the same document. It is catastrophic if symlink "A" was pointing at regular file "A".

Bug #324930 should probably be solved separately but I do think this demonstrates that the present bug can show up in obscure cases.

---

Now, I haven't contributed a single line of code to GNOME so take what I'm about to say with a grain of salt, but I wonder if the problem couldn't be fixed as follows:

1. Never make the overwrite dialog 'rm' a file, just have it continue the operation at hand;

2. When copying a regular file just do a fopen() (or its gnome-vfs equivalent) and write the content. The problem reported in the present bug would simply have the fopen() fail.

3. When copying a directory or symlink, first read the filename and possible the target file name into memory. Delete the file to overwrite only if this succeeds.
Comment 11 António Fernandes 2013-07-05 22:11:37 UTC
I cannot reproduce this bug.

I followed the steps from comment #0 and got this dialog:
 ___________________________________________________________________________
|     .                                                                     |
|    / \    Error while copying.                                            |
|   / ! \                                                                   |
|  /_____\  There was an error getting information about “x”.               |
|                                                                           |
|           v Show more details                                             |
|                                                                           |
|           Error when getting information for file '/home/antonio/x': No   |
|           such file or directory                                          |
|                                                                           |
|                      [  Cancel  ] [ Skip All ] [   Skip   ] [  Retry   ]  |
|___________________________________________________________________________|

It never tries to replace, so the file on remote file is not deleted.

Considering its age, this bug report is likely obsolete now.
Comment 12 Alexandre Franke 2015-06-17 13:26:10 UTC
Same result here as comment 11. Closing as obsolete.