Since I mistakenly put this issue along with another thread specifically about the junctioned folder themselves, here's a proper, enhanced bug report with the correct context.
When moving/renaming files between two panes showing different drives, but where one pane shows a folder junctioned to one on the other drive (i.e. they both actually represent content the same drive) files are copied and deleted instead of simply moved or renamed.
Example:
Create a folder D:\target
Create a junction C:\target -> D:\target
Copy a large file into the folder. (large means you'll be able to measure the time of the operation)
Show C:\target in the left pane and D:\target in the right.
Move the file with a new name (F6) from one side to the other. (Shift-F6 doesn't exhibit the problem)
Result: The file is copied to the new name and the old file is deleted.
Expected: The file should just be renamed since both panes actually show a folder on the same drive.
Cheers
/axl
Move/rename within junctions perform copy/delete
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Indeed Total Commander only moves files within the same drive letter at this time, it's not currently possible to move files between different drive letters pointing to the same partition, sorry. I haven't found a fast way to check this yet.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
After some quick checking around last night I found a few ways to track down the "real" path of files and folders, but it seems to be available only in Vista or later, so that's of no use. I did however try the above move-operation in Powershell (I'm not allowed to post the link yet, you'll find it if you need it), using Move-Item, and it performed a proper rename although the file was referenced through different drives, so it's possible at least. Filemon gave no indications on what API calls that were involved however, so I'll continue looking.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I assume that it just calls MoveFile(Ex) and hopes that the operating system can decide whether the file can be moved or not. In the worst case with exotic drives, the data would be copied and then deleted within MoveFileEx, without a chance to interrupt it. MoveFileEx supports a parameter MOVEFILE_COPY_ALLOWED, but I don't know how reliable this is with non-Windows drives like Netware or Samba, and how much delay it causes when calling MoveFileEx EVERY time before copying the file...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com