Directory.GetFiles and VssSnapshotProperties.SnapshotDeviceObject

Feb 26, 2009 at 7:35 PM
  1. <cite>Chris Bellach</cite>
    <small>February 26th, 2009 at 4:10 am </small>

    I’m using the last build of AlphaVSS and the last build of AlphaFS. I’m running a VSS backup and when I try to get a list of files on the shadow copy to backup using Alphaleonis.Win32.Filesystem.Directory.GetFiles using the VssSnapshotProperties.SnapshotDeviceObject I get an illegal path exception. After looking at the source code for the getfiles function I found that you check the path for any ‘?’ which the snapshotdeviceobject always starts with “\\\\?\\GLOBALROOT\\Device\\”. I put a work around in to check for this specific string and allow it but I’m wondering the reason to make this check and what would be a proper fix for this situation. I know the AlphaFS library is supposed to support shadow copy access so I’m not sure if this was overlooked or by design. Thanks for any help you can provide

  2. <cite>DeCaf</cite>
    <small>February 26th, 2009 at 12:44 pm </small>

    Where in the source did you find this check?

    And could I please ask you to continue this discussion on the discussion forum on http://alphafs.codeplex.com instead of here?

I just copy and pasted the conversation from my original comment above. To answer your question the check for any '?' in the path passed to Directory.GetFiles is at line 1141 in AlphaFS\Filesystem\Directory.cs
Coordinator
Feb 26, 2009 at 8:46 PM
Thanks for moving the discussion here.

And yes, there appears to be a problem with this. The reason would be the invalid path chars which actually forbids the questionmark. However, this appears to be fixed in the latest version in the repository. Perhaps you could get the latest source and see if that doesn't work better? 

But yes, as you assumed what you attempted should definately work, and it is definately a bug.
Feb 26, 2009 at 9:12 PM
Thanks for your help. I thought I had the latest build. I inherited this project from someone else and they told me it was up to date. Thanks again for your help