Ver código fonte

patch: symlink support

HOME 3 anos atrás
pai
commit
c747fba44e

+ 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;