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