Browse Source

patch: symlink support

HOME 3 years ago
parent
commit
c747fba44e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      DiskAccessLibrary/Mod/BlockDifferencingDiskImage/BddInfo.cs

+ 3 - 3
DiskAccessLibrary/Mod/BlockDifferencingDiskImage/BddInfo.cs

@@ -41,9 +41,9 @@ namespace DiskAccessLibrary
             if (false == readEntries) return;
             if (null != BasedImagePath)
             {
-                var baseInfo = new FileInfo(BasedImagePath);
-                if (snapMatchLength != baseInfo.Length)
-                    throw new InvalidDataException("Snapshot size no match to based image");
+                if (false == File.Exists(BasedImagePath)) throw new FileNotFoundException("based image not found", BasedImagePath);
+                using var ms = File.OpenRead(BasedImagePath);
+                if (snapMatchLength != ms.Length) throw new InvalidDataException("Snapshot size no match to based image");
             }
 
             EntryTableOffset = fs.Position;