alphaleonis / AlphaFS

AlphaFS is a .NET library providing more complete Win32 file system functionality to the .NET platform than the standard System.IO classes.
http://alphafs.alphaleonis.com/
MIT License
562 stars 99 forks source link

Exception when moving or renaming a folder after updating from 2.1.3 to 2.2.1 #444

Closed mlaily closed 6 years ago

mlaily commented 6 years ago

The two following cases throw exception with the latest version, but worked as expected before:

Moving an existing empty folder into another existing folder:

Alphaleonis.Win32.Filesystem.NotSameDeviceException : (17) The system cannot move the file to a different disk drive. | Read: [C:\Users\m.laily\AppData\Local\Temp\898576e5-9930-4ed9-b7d0-3f6366a16d04\TestFolder] | Write: [C:\Users\m.laily\AppData\Local\Temp\898576e5-9930-4ed9-b7d0-3f6366a16d04\Dest\TestFolder]
TearDown : Alphaleonis.Win32.Filesystem.DirectoryNotEmptyException : (145) The directory is not empty: [\\?\C:\Users\m.laily\AppData\Local\Temp\898576e5-9930-4ed9-b7d0-3f6366a16d04]
   at Alphaleonis.Win32.NativeError.ThrowException(UInt32 errorCode, String readPath, String writePath) in D:\Coding\Projects\GitHub\alphafs\AlphaFS\NativeError.cs:line 129
   at Alphaleonis.Win32.Filesystem.Directory.ValidateAndUpdateCopyMoveAction(String sourcePathLp, String destinationPathLp, Nullable`1 copyOptions, Nullable`1 moveOptions, Nullable`1& newCopyOptions, Nullable`1& newMoveOptions, Boolean& isCopy, Boolean& emulateMove) in D:\Coding\Projects\GitHub\alphafs\AlphaFS\Filesystem\Directory Class\Directory.Copy.cs:line 907
   at Alphaleonis.Win32.Filesystem.Directory.CopyMoveCore(KernelTransaction transaction, String sourcePath, String destinationPath, Boolean preserveDates, Nullable`1 copyOptions, Nullable`1 moveOptions, CopyMoveProgressRoutine progressHandler, Object userProgressData, CopyMoveResult copyMoveResult, PathFormat pathFormat) in D:\Coding\Projects\GitHub\alphafs\AlphaFS\Filesystem\Directory Class\Directory.Copy.cs:line 725
   at Alphaleonis.Win32.Filesystem.DirectoryInfo.CopyToMoveToCore(String destinationPath, Boolean preserveDates, Nullable`1 copyOptions, Nullable`1 moveOptions, CopyMoveProgressRoutine progressHandler, Object userProgressData, String& longFullPath, PathFormat pathFormat) in D:\Coding\Projects\GitHub\alphafs\AlphaFS\Filesystem\DirectoryInfo Class\DirectoryInfo.CopyTo.cs:line 414
   at Alphaleonis.Win32.Filesystem.DirectoryInfo.MoveTo(String destinationPath) in D:\Coding\Projects\GitHub\alphafs\AlphaFS\Filesystem\DirectoryInfo Class\DirectoryInfo.MoveTo.cs:line 56

Renaming an existing empty folder to a new available name:


Alphaleonis.Win32.Filesystem.NotSameDeviceException : (17) The system cannot move the file to a different disk drive. | Read: [C:\Users\m.laily\AppData\Local\Temp\5d201314-d78b-4f49-901d-9aa581581fba\TestFolder] | Write: [C:\Users\m.laily\AppData\Local\Temp\5d201314-d78b-4f49-901d-9aa581581fba\TestFolder2]
   at Alphaleonis.Win32.NativeError.ThrowException(UInt32 errorCode, String readPath, String writePath) in D:\Coding\Projects\GitHub\alphafs\AlphaFS\NativeError.cs:line 129
   at Alphaleonis.Win32.Filesystem.Directory.ValidateAndUpdateCopyMoveAction(String sourcePathLp, String destinationPathLp, Nullable`1 copyOptions, Nullable`1 moveOptions, Nullable`1& newCopyOptions, Nullable`1& newMoveOptions, Boolean& isCopy, Boolean& emulateMove) in D:\Coding\Projects\GitHub\alphafs\AlphaFS\Filesystem\Directory Class\Directory.Copy.cs:line 907
   at Alphaleonis.Win32.Filesystem.Directory.CopyMoveCore(KernelTransaction transaction, String sourcePath, String destinationPath, Boolean preserveDates, Nullable`1 copyOptions, Nullable`1 moveOptions, CopyMoveProgressRoutine progressHandler, Object userProgressData, CopyMoveResult copyMoveResult, PathFormat pathFormat) in D:\Coding\Projects\GitHub\alphafs\AlphaFS\Filesystem\Directory Class\Directory.Copy.cs:line 725
   at Alphaleonis.Win32.Filesystem.DirectoryInfo.CopyToMoveToCore(String destinationPath, Boolean preserveDates, Nullable`1 copyOptions, Nullable`1 moveOptions, CopyMoveProgressRoutine progressHandler, Object userProgressData, String& longFullPath, PathFormat pathFormat) in D:\Coding\Projects\GitHub\alphafs\AlphaFS\Filesystem\DirectoryInfo Class\DirectoryInfo.CopyTo.cs:line 414
   at Alphaleonis.Win32.Filesystem.DirectoryInfo.MoveTo(String destinationPath) in D:\Coding\Projects\GitHub\alphafs\AlphaFS\Filesystem\DirectoryInfo Class\DirectoryInfo.MoveTo.cs:line 56
Yomodo commented 6 years ago

Should be fixed now.