diff --git a/lib/dat/writer.ts b/lib/dat/writer.ts index 4062e14..42f60b2 100644 --- a/lib/dat/writer.ts +++ b/lib/dat/writer.ts @@ -181,6 +181,10 @@ export class DataWriter { this.indexWriter.writeFlags(flags); } + getFlags(): number { + return this.indexWriter.getFlags(); + } + getStats() { return { dataPath: this.dataPath, diff --git a/lib/idx/writer.ts b/lib/idx/writer.ts index 5fa3d73..18d451d 100644 --- a/lib/idx/writer.ts +++ b/lib/idx/writer.ts @@ -161,6 +161,11 @@ export class IndexWriter { return this.latestSequence; } + getFlags(): number { + if (!this.headerBuf) throw new Error('Index file not opened'); + return this.headerBuf.readUInt32LE(41); + } + writeHeader(): void { if (!this.headerBuf || this.fd === null) return;