Bug 194999 - [ftp] Renaming a file or directory deletes it (sometimes)
Summary: [ftp] Renaming a file or directory deletes it (sometimes)
Status: RESOLVED DUPLICATE of bug 194204
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: dsdp.tm.rse-inbox CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-30 01:56 EDT by Michael Scharf CLA
Modified: 2007-07-02 04:40 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Scharf CLA 2007-06-30 01:56:25 EDT
When I copy a file to the remote site and rename it, the files sometimes gets deleted!
Other clients allow me to rename the file without loosing it....

NOOP
200 NOOP command successful

CWD /eclipse
250 CWD command successful

PORT 192,168,2,34,10,83
200 PORT command successful

LIST
150 Opening ASCII mode data connection for file list

226 Transfer complete.

NOOP
200 NOOP command successful

CWD /
250 CWD command successful

PORT 192,168,2,34,10,85
200 PORT command successful

LIST
150 Opening ASCII mode data connection for file list

226 Transfer complete.

NOOP
200 NOOP command successful

CWD /eclipse
250 CWD command successful

PORT 192,168,2,34,10,89
200 PORT command successful

LIST
150 Opening ASCII mode data connection for file list

226 Transfer complete.

NOOP
200 NOOP command successful

CWD /
250 CWD command successful

PORT 192,168,2,34,10,91
200 PORT command successful

LIST
150 Opening ASCII mode data connection for file list

226 Transfer complete.

NOOP
200 NOOP command successful

CWD /eclipse/firefox
250 CWD command successful

PORT 192,168,2,34,10,93
200 PORT command successful

LIST
150 Opening ASCII mode data connection for file list

226 Transfer complete.

NOOP
200 NOOP command successful

CWD /eclipse/firefox
250 CWD command successful

PORT 192,168,2,34,10,97
200 PORT command successful

STOR default_style.htm
150 Opening ASCII mode data connection for default_style.htm

226 Transfer complete.

NOOP
200 NOOP command successful

CWD /eclipse/firefox
250 CWD command successful

PORT 192,168,2,34,10,99
200 PORT command successful

LIST
150 Opening ASCII mode data connection for file list

226 Transfer complete.

NOOP
200 NOOP command successful

CWD /eclipse/firefox
250 CWD command successful

PORT 192,168,2,34,10,101
200 PORT command successful

LIST
150 Opening ASCII mode data connection for file list

226 Transfer complete.

NOOP
200 NOOP command successful

CWD /eclipse
250 CWD command successful

PORT 192,168,2,34,10,105
200 PORT command successful

LIST
150 Opening ASCII mode data connection for file list

226 Transfer complete.

NOOP
200 NOOP command successful

CWD /
250 CWD command successful

PORT 192,168,2,34,10,107
200 PORT command successful

LIST
150 Opening ASCII mode data connection for file list

226 Transfer complete.

NOOP
200 NOOP command successful

RNFR /eclipse/firefox/default_style.htm
350 File or directory exists, ready for destination name.

RNTO xxxx.htm
250 Rename successful
Comment 1 Kevin Doyle CLA 2007-06-30 14:22:59 EDT
Michael, it shouldn't be deleting the files.  They are being moved.  Bug 194204 is open for this.

Based on the console log the renamed file should be in /.  Since the cwd is / and RNTO doesn't specify the path for the renamed file, it is moved to the cwd.  The workaround currently is to refresh twice on the file you want to rename before doing the rename.  This will ensure the cwd is correct. 
Comment 2 Michael Scharf CLA 2007-07-01 21:08:03 EDT
oh no! I tried to rename a file to index.html. It was overwriting (without question) the index.html in my root directory, that's worse than deleting the file....

Even if a workaround this exists, it is very dangerous. Suppose, you maintain a web-page, put something confidential into a password protected area and rename the file. It'll appear as home-page!
Comment 3 Kevin Doyle CLA 2007-07-01 23:43:03 EDT
oh wow, thats very nasty.  What I have done for now is switch to using ssh connection for any web work.  

I've changed the severity of bug 194204 to critical based on your comments.
Comment 4 Michael Scharf CLA 2007-07-01 23:49:23 EDT
...well I only have ftp access to the webserver :-/
Comment 5 Javier Montalvo Orús CLA 2007-07-02 04:40:51 EDT
It's a really nasty effect caused by moving files sometimes when renaming them. It's fixed now by fixing bug 194204 (Renaming Files/Folders moves them sometimes)

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