1
0
mirror of https://github.com/garraflavatra/go-fmp.git synced 2025-06-28 04:25:11 +00:00

Rewrite fmp_chunk.go to use switch, add delayed

This commit is contained in:
2025-06-13 14:44:32 +02:00
parent 41041e124c
commit 88ea33c76e
3 changed files with 187 additions and 212 deletions

View File

@ -89,6 +89,14 @@ func OpenFile(path string) (*FmpFile, error) {
case FMP_CHUNK_NOOP:
// noop
}
if chunk.Delayed {
if len(currentPath) == 0 {
println("warning: delayed pop without path")
} else {
currentPath = currentPath[:len(currentPath)-1]
}
}
}
ctx.currentSectorID = sector.NextID
@ -129,6 +137,7 @@ func (ctx *FmpFile) readHeader() error {
}
func (ctx *FmpFile) readSector() (*FmpSector, error) {
println("------- Reading sector", ctx.currentSectorID)
buf := make([]byte, sectorHeaderSize)
n, err := ctx.stream.Read(buf)