Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Directory.Move operation worked in v2.0.1, but now fails in v.2.2.1 #434

Closed
warrenlbrown opened this issue Apr 6, 2018 · 4 comments
Closed
Assignees
Labels
Milestone

Comments

@warrenlbrown
Copy link

`This worked in v2.0.1, but fails in latest release v2.2.1

string srcFile = @"C:$Sherpa Software\Altitude\Agents\SP\Logs\2018_04_06.log";
string dstFile = @"T:$Sherpa Software\Altitude\Agents\SP\Logs\2018_04_06.log";

MoveOptions options = MoveOptions.CopyAllowed | MoveOptions.WriteThrough;
options |= MoveOptions.ReplaceExisting;
Directory.Move(source, destination, options);

Error moving C:$Sherpa Software\Altitude\Agents\SP\Logs\2018_04_06.log to T:$Sherpa Software\Altitude\Agents\SP\Logs\2018_04_06.log: System.IO.IOException: (267) The directory name is invalid: [C:$Sherpa Software\Altitude\Agents\SP\Logs\2018_04_06.log]
at Alphaleonis.Win32.NativeError.ThrowException(UInt32 errorCode, String readPath, String writePath) in C:\Users\brown.SHERPA\Downloads\AlphaFS-2.2.1\AlphaFS-2.2.1\AlphaFS\NativeError.cs:line 87
at Alphaleonis.Win32.Filesystem.FindFileSystemEntryInfo.ThrowPossibleException(UInt32 lastError, String pathLp) in C:\Users\brown.SHERPA\Downloads\AlphaFS-2.2.1\AlphaFS-2.2.1\AlphaFS\Filesystem\FindFileSystemEntryInfo.cs:line 404
at Alphaleonis.Win32.Filesystem.FindFileSystemEntryInfo.FindFirstFile(String pathLp, WIN32_FIND_DATA& win32FindData, Boolean suppressException) in C:\Users\brown.SHERPA\Downloads\AlphaFS-2.2.1\AlphaFS-2.2.1\AlphaFS\Filesystem\FindFileSystemEntryInfo.cs:line 297
at Alphaleonis.Win32.Filesystem.FindFileSystemEntryInfo.d__841.MoveNext() in C:\Users\brown.SHERPA\Downloads\AlphaFS-2.2.1\AlphaFS-2.2.1\AlphaFS\Filesystem\FindFileSystemEntryInfo.cs:line 459 at Alphaleonis.Win32.Filesystem.Directory.CopyDeleteCore(KernelTransaction transaction, String sourcePathLp, String destinationPathLp, Boolean preserveDates, Boolean emulateMove, Nullable1 copyOptions, CopyMoveProgressRoutine progressHandler, Object userProgressData, CopyMoveResult copyMoveResult) in C:\Users\brown.SHERPA\Downloads\AlphaFS-2.2.1\AlphaFS-2.2.1\AlphaFS\Filesystem\Directory Class\Directory.Copy.cs:line 803
at Alphaleonis.Win32.Filesystem.Directory.CopyMoveCore(KernelTransaction transaction, String sourcePath, String destinationPath, Boolean preserveDates, Nullable1 copyOptions, Nullable1 moveOptions, CopyMoveProgressRoutine progressHandler, Object userProgressData, CopyMoveResult copyMoveResult, PathFormat pathFormat) in C:\Users\brown.SHERPA\Downloads\AlphaFS-2.2.1\AlphaFS-2.2.1\AlphaFS\Filesystem\Directory Class\Directory.Copy.cs:line 748
at Alphaleonis.Win32.Filesystem.Directory.Move(String sourcePath, String destinationPath, MoveOptions moveOptions) in C:\Users\brown.SHERPA\Downloads\AlphaFS-2.2.1\AlphaFS-2.2.1\AlphaFS\Filesystem\Directory Class\Directory.Move.cs:line 151
at SherpaSoftware.IO.LongPathTools.MoveFile(String source, String destination, Boolean overWrite) in T:\SVN WORK\Utils\DebugHound\Externals\SharedLibs\sherpaSoftware.Common\sherpaSoftware.Common\IO\LongPathTools.cs:line 2949
at SherpaSoftware.IO.Files.Move(String source, String destination, Boolean overWrite) in T:\SVN WORK\Utils\DebugHound\Externals\SharedLibs\sherpaSoftware.Common\sherpaSoftware.Common\IO\Main.cs:line 528
at sherpaSoftware.DebugHound.dlgMainForm.mnuMoveFile_Click(Object sender, EventArgs e) in T:\SVN WORK\Utils\DebugHound\DebugHound\dlgMainForm.cs:line 8490
`

@warrenlbrown warrenlbrown reopened this Apr 6, 2018
@warrenlbrown warrenlbrown changed the title File.Move operation worked in v2.0.1, but now fails in v.2.2.1 Directory.Move operation worked in v2.0.1, but now fails in v.2.2.1 Apr 6, 2018
@Yomodo
Copy link
Collaborator

Yomodo commented Apr 6, 2018

I'm a bit confused, are you performing a Directory.Move on the log file?

string srcFile = @"C:$Sherpa Software\Altitude\Agents\SP\Logs\2018_04_06.log";

System.IO.IOException: (267) The directory name is invalid: [C:$Sherpa Software\Altitude\Agents\SP\Logs\2018_04_06.log

@Yomodo Yomodo self-assigned this Apr 6, 2018
@Yomodo Yomodo added Bug 🪲 and removed Bug 🪲 labels Apr 6, 2018
@Yomodo
Copy link
Collaborator

Yomodo commented May 23, 2018

@warrenlbrown: I guess the error is: (267) The directory name is invalid, and not a Directory.Move error.
Could you confirm/clarify or close this issue.

@warrenlbrown
Copy link
Author

This is a bug/regression. Note MS docs https://msdn.microsoft.com/en-us/library/system.io.directory.move(v=vs.110).aspx. src and dest can both be files

Thank you.

@Yomodo
Copy link
Collaborator

Yomodo commented May 23, 2018

Ok, it's clear now what you want to do.

@Yomodo Yomodo added this to the vNext milestone May 23, 2018
Yomodo added a commit that referenced this issue May 23, 2018
@Yomodo Yomodo closed this as completed May 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants