Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File.Copy using \\?\Volume{guid} syntax throws not ready error #520

Open
EricZimmerman opened this issue Feb 4, 2020 · 2 comments
Open
Assignees
Labels

Comments

@EricZimmerman
Copy link

I am trying to copy files off an NTFS volume using the following syntax:

File.Copy(@"\?\Volume{2b0bf6a2-b2fb-4893-872a-5e4b19072ee2}\Users\e\AppData\Roaming\Microsoft\Windows\Recent!ForDDrive.lnk",@"C:\temp\1.lnk",CopyOptions.None)

but am always getting an exception about the device not being ready:

(21) The device is not ready: [\?\Volume{2b0bf6a2-b2fb-4893-872a-5e4b19072ee2}]

yet, if i navigate to that folder in Windows, i see a directory listing with the files, etc:

\?\Volume{2b0bf6a2-b2fb-4893-872a-5e4b19072ee2}\Users\e\AppData\Roaming\Microsoft\Windows\Recent

i have used this same path with other parts of AlphaFS and it works fine, so not sure why this is not working. i tried using PathFormat options too and it still did the same thing.

i looked at the unit test example to access things via shadow copies that uses GLOBALROOT to see if that shed any light on things, but it did not.

based on the stack, i think the issue is with the call to Directory.ExistsDrive.cs on line 76 as i had to use a different approach earlier in my project. if you do just Directory.Exists, it works, but the ExistsDrive thing explodes.

stack:

at Alphaleonis.Win32.Filesystem.Directory.ExistsDriveOrFolderOrFile(KernelTransaction transaction, String path, Boolean isFolder, Int32 lastError, Boolean throwIfDriveNotExists, Boolean throwIfFolderOrFileNotExists) in C:\Users\jjangli\Documents\GitHub\AlphaFS\AlphaFS\Filesystem\Directory Class\Directory.ExistsDrive.cs:line 76
at Alphaleonis.Win32.Filesystem.File.CopyMoveCore(KernelTransaction transaction, Boolean driveChecked, Boolean isFolder, String sourcePath, String destinationPath, Nullable1 copyOptions, Nullable1 moveOptions, Boolean preserveDates, CopyMoveProgressRoutine progressHandler, Object userProgressData, CopyMoveResult copyMoveResult, PathFormat pathFormat) in C:\Users\jjangli\Documents\GitHub\AlphaFS\AlphaFS\Filesystem\File Class\File.Copy.cs:line 761
at Alphaleonis.Win32.Filesystem.File.Copy(String sourcePath, String destinationPath, CopyOptions copyOptions, PathFormat pathFormat) in C:\Users\jjangli\Documents\GitHub\AlphaFS\AlphaFS\Filesystem\File Class\File.Copy.cs:line 282
at kape.Classes.Copy.RawDiskLibCopy.Copy(String vssMountDirectory, Boolean deduplicate, Boolean usingContainer, TimeSpan findTime) in D:\Code\kape\kape\Classes\Copy\RawDiskLibCopy.cs:line 371

@Yomodo Yomodo self-assigned this Feb 6, 2020
@Yomodo Yomodo added the Bug 🪲 label Feb 6, 2020
@dpps5387690
Copy link

Any patch this bug method?

@semwarden
Copy link

Is there any fix for this bug? I'm facing the same problem. Can someone describes, how they solved this bug? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants