From 09552b3ebc34502d06db6a6ba5a586b09fe96278 Mon Sep 17 00:00:00 2001 From: manusoft Date: Mon, 25 May 2026 17:33:50 +0400 Subject: [PATCH] Add checksumOffset to footer and update footer layout Added checksumOffset to record CHECKSUM block position and wrote it to the footer after metadataOffset. The footer now includes indexOffset, metadataOffset, checksumOffset, and the footer magic string. --- src/Filo/Core/FiloWriter.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Filo/Core/FiloWriter.cs b/src/Filo/Core/FiloWriter.cs index 58b7b6d..db54a26 100644 --- a/src/Filo/Core/FiloWriter.cs +++ b/src/Filo/Core/FiloWriter.cs @@ -205,6 +205,8 @@ public async Task WriteAsync() await output.WriteAsync(BitConverter.GetBytes(metaBytes.Length)); await output.WriteAsync(metaBytes); + var checksumOffset = output.Position; + // CHECKSUM block (placeholder) var checksumBytes = Encoding.UTF8.GetBytes("{}"); await output.WriteAsync(BitConverter.GetBytes(checksumBytes.Length)); @@ -213,6 +215,8 @@ public async Task WriteAsync() // FOOTER await output.WriteAsync(BitConverter.GetBytes(indexOffset)); await output.WriteAsync(BitConverter.GetBytes(metadataOffset)); + await output.WriteAsync(BitConverter.GetBytes(checksumOffset)); + await output.WriteAsync(Encoding.ASCII.GetBytes(FiloConstants.FooterMagic)); } catch (UnauthorizedAccessException uaEx)