TC copies between junction and its target drive on move
Moderators: Hacker, petermad, Stefan2, white
TC copies between junction and its target drive on move
E.g. I have folder E:\1 and its junction F:\1. So, folder F:\1 is physically on drive E:. If I move files from F:\1 to some folder on drive E: or vice versa, TC does copy+delete instead of just move. Standard copy method is used.
There is a function MoveFileEx that does fast move. Also it supports flag MOVEFILE_COPY_ALLOWED that allows to perform slow move (copy+delete) if source and target are on different volumes.
Tested on TC 8.01x32.
There is a function MoveFileEx that does fast move. Also it supports flag MOVEFILE_COPY_ALLOWED that allows to perform slow move (copy+delete) if source and target are on different volumes.
Tested on TC 8.01x32.
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Are you sure that MoveFileEx can really move the files in this special case?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I'm using it in my Virtual Panel, it copies+deletes or simply moves depending on source and target volumes. Also I'm using MoveFileWithProgress (in FsGetFile function) but they both support mentioned flag. I've tried to move file from VP to junction and it works correctly.
AFAIK function GetFileInformationByHandle allows to get volume serial number to check if source file and target folders are within the same volume. But it may be slower for little files so I think it would be enough to check it just for source and target folders (the only exception will be the file symbolic link) if you use other copy modes. But it seems that it is only available since WinXP.
AFAIK function GetFileInformationByHandle allows to get volume serial number to check if source file and target folders are within the same volume. But it may be slower for little files so I think it would be enough to check it just for source and target folders (the only exception will be the file symbolic link) if you use other copy modes. But it seems that it is only available since WinXP.
TC 8.50b7 still copies+deletes file between dirs within the same volume in case of junctions. It is really easy to use MoveFileWithProgress with MOVEFILE_COPY_ALLOWED. I'm using it in my CopyTree plugin too, and it moves files immediately.
Why do I use junctions? It is simple. I redirected user folders (like Desktop or Documents) to another drive, and when I move e.g. movies from that drive's root to desktop folder (which is on the same drive) TC wastes a lot of time for unnecessary copying data.
Why do I use junctions? It is simple. I redirected user folders (like Desktop or Documents) to another drive, and when I move e.g. movies from that drive's root to desktop folder (which is on the same drive) TC wastes a lot of time for unnecessary copying data.
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Sorry but I find it too risky to use this function. When I read the MSDN description, it seems that it's only supported by certain types of file systems, and it even seems to be platform-dependent:
In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
Technology Supported
Server Message Block (SMB) 3.0 protocol
SMB 3.0 Transparent Failover (TFO)
SMB 3.0 with Scale-out File Shares (SO)
Cluster Shared Volume File System (CsvFS)
Resilient File System (ReFS)
And it's not described that will happen with NTFS, FAT(32) or Samba shares.
In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
Technology Supported
Server Message Block (SMB) 3.0 protocol
SMB 3.0 Transparent Failover (TFO)
SMB 3.0 with Scale-out File Shares (SO)
Cluster Shared Volume File System (CsvFS)
Resilient File System (ReFS)
And it's not described that will happen with NTFS, FAT(32) or Samba shares.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I think MSDN only tells that listed technologies also support this function. I doubt they will break thousands of Win7 applications that use this function.
Look, they write same text for CopyFile function.
I just tried to move files to a network share and between NTFS folders in Win2012 via CopyTree, it moves w/o any problems.
I'm sure it will work with FAT32 too.
Look, they write same text for CopyFile function.

I just tried to move files to a network share and between NTFS folders in Win2012 via CopyTree, it moves w/o any problems.
I'm sure it will work with FAT32 too.