This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#9864 - When cutting and pasting, overwriting doesn't work
Attached to Project:
Rockbox
Opened by Boris Gjenero (dreamlayers) - Monday, 02 February 2009, 21:38 GMT+2
Opened by Boris Gjenero (dreamlayers) - Monday, 02 February 2009, 21:38 GMT+2
|
DetailsWhen moving files or directories by cutting and pasting, if the destination exists I am asked if I want to overwrite. If I say yes, the operation fails. This is because the rename fails because the destination exists. Copying and pasting works properly.
The attached patch fixes the problem by deleting the target if it exists just before the rename. (At this point the user has already agreed to overwrite the target.) This was tested with r19907 on my 30GB 5G iPod. It should not depend on the player type. |
This task depends upon
Could you please add some instructions for how to reproduce?
/file
/directory/file
Hold select on /file, cut. Go into /dir, hold select, paste and confirm that you want to overwrite by pressing select. You'll get "Paste failed".
To see the issue when pasting directories, have:
/dira/file
/dirb/dira/file
Hold select on /dira, cut. Go into /dirb, hold select, paste and confirm that you want to overwrite by pressing select. Again "Paste failed".
In the file case, both my iPod and the sim ask if I want to overwrite. In the directory case, my iPod asks but the sim doesn't. If I enable dircache in the sim, then it asks if I want to overwrite the directory. I think this is because when dircache is disabled, file_exists in apps/misc.c checks for the existence of a file by trying to open it for reading. Rockbox and some other OSes allow opening directories like that, but Windows doesn't.
I found another issue: overwriting a directory with a file or a file with a directory fails, and this happens with both cut and copy, and even with the patch I submitted.
The issue with copying files over a dir or vice versa is of course a bug. I think, there is a function "dir_exists" which should also be called prior to copying.