Bug 52115 - rename of directory misbehaves
Summary: rename of directory misbehaves
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-19 20:52 UTC by colesen
Modified: 2004-01-12 09:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description colesen 2002-12-19 20:52:53 UTC
Version:           3.1.0 (using KDE 3.1.0 (RC5))
Installed from:    compiled sources
Compiler:          gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
OS:          Linux (i686) release 2.4.18-18.7.x

To reproduce:
1. Open Konqueror as file manager (in $HOME).
2. Create 2 directories - say d1 and d2.
3. Open d1 and create a directory - say d11.
4. Open d2 and create a directory - say d21.
6. Using the 3rd button menu, rename d1 to d2. Konqueror pops up a popup to chose another name. Chose say d3.
7. Open d3. The is where the problem is. d3 now contains d1 and not d11.
Comment 1 Luís Pedro Coelho 2002-12-25 18:28:02 UTC
I am unable to reproduce this in HEAD (fairly recent). 
 
I tried several combinations of keyboard (F10 + F2) and RMB to create or rename 
the directories and it always works.  
 
Does it matter if the directories already exist or must you create them especially for 
this? 
In the end, do you mean that d3 contains d1 which then contains d11 or did d11 get 
change to d1? 
Comment 2 colesen 2002-12-26 21:01:11 UTC
Does it matter if the directories already exist or must you create them 
especially for this?
I just re-tried the above steps with re-opening Konqueror after creating the 
directories but before doing the rename. Makes no difference.

In the end, do you mean that d3 contains d1 which then contains d11 or did d11 
get change to d1?
d11 gets changed to d1. (Or does the original d1 replace d11 i.e. does the 
parent become child?)  

More elaboration:

Before rename
$HOME/d1/d11
$HOME/d2/d21

After rename - expected
$HOME/d3/d11
$HOME/d2/d21

After rename - observed
$HOME/d3/d1
$HOME/d2/d21

Details on rename operation

a. Place mouse on d1
b. Hold down 3rd button
c. Move mouse to "Rename"
d. Release 3rd button.
e. Konqueror opens the name field for editing
f. Press backspace once (to erase "1" in d1).
g. Enter 2 (as replacement for the "1").
h. Press Return.
h. Konqueror pops up "Directory Already Exists"
i. Move mouse to end of "d2" in the popup
j. Backspace once (to erase "2")
k. Enter 3 (as replacement for the "2").
l. Press Return.

Another observation
I re-re-tried the entire operation and waited a couple of minutes after 
creating the directories but before doing the rename. What I see after doing 
the rename is that the timestamp on d2 and d21 are unchanged but the timestamp 
on both d3 and d1 (which again should have been d11) are the same and updated 
to current time.
Comment 3 Thilo Bangert 2003-11-17 11:17:20 UTC
i can confirm this bug with kde-3.1.4 on linux 2.4.2x gcc2.95.3 on a ext3 partition.

i don't know if one looses data on this, but it sounds pretty severe to me. data corruption possible
Comment 4 Thilo Bangert 2003-11-17 11:42:00 UTC
i have this structure:

d1*
 |-> somefolder*
   |-> somefile
d2*
 |-> anotherfolder*
   |-> anotherfile

now i want to rename d1 to d2. warning comes  up and asks for a different name. i choose d3...

now i get a warning, that the file d1/somefolder/somefile already exists. i am asked if i want to choose a different name - d1 is proposed.

following situations:

a) i press abort.

	this is the directory structure i get:

	d1*
	 |-> somefolder*
	   |-> somefile
	d2*
	 |-> anotherfolder*
	   |-> anotherfile
	d3*
	 |-> d1*

b) i choose a new filename (d1_1) and press rename

	d2*
	 |-> anotherfolder*
	   |-> anotherfile
	d3*
	 |-> d1*
	 |-> d1_1

	d1_1 is a file. its the "somefile" renamed to d1_1

everything marked with a * is a folder...
Comment 5 David Faure 2004-01-12 09:49:16 UTC
Subject: kdelibs/kio/kio

CVS commit by faure: 

Fixed "Bug 52115: rename of directory misbehaves" (happened when getting the
rename dialog and then choosing another name). This also shows that the fast
"::rename()" path isn't taken once "dest already exists" happens. But at least
it works the long way now (move+del).
CCMAIL: 52115-done@bugs.kde.org


  M +32 -12    job.cpp   1.365