Re-write data fullreader & reader

Moved directory and the rest of the inodes to manual decoding
This commit is contained in:
Caleb Gardner
2025-06-06 06:37:39 -05:00
parent f32cb520dc
commit 3378651686
9 changed files with 200 additions and 412 deletions
+14 -14
View File
@@ -13,6 +13,20 @@ type Directory struct {
ParentNum uint32
}
func ReadDir(r io.Reader) (d Directory, err error) {
dat := make([]byte, 16)
_, err = r.Read(dat)
if err != nil {
return
}
d.BlockStart = binary.LittleEndian.Uint32(dat)
d.LinkCount = binary.LittleEndian.Uint32(dat[4:])
d.Size = binary.LittleEndian.Uint16(dat[8:])
d.Offset = binary.LittleEndian.Uint16(dat[10:])
d.ParentNum = binary.LittleEndian.Uint32(dat[12:])
return
}
type EDirectory struct {
LinkCount uint32
Size uint32
@@ -31,20 +45,6 @@ type DirectoryIndex struct {
Name []byte
}
func ReadDir(r io.Reader) (d Directory, err error) {
dat := make([]byte, 16)
_, err = r.Read(dat)
if err != nil {
return
}
d.BlockStart = binary.LittleEndian.Uint32(dat)
d.LinkCount = binary.LittleEndian.Uint32(dat[4:])
d.Size = binary.LittleEndian.Uint16(dat[8:])
d.Offset = binary.LittleEndian.Uint16(dat[10:])
d.ParentNum = binary.LittleEndian.Uint32(dat[12:])
return
}
func ReadEDir(r io.Reader) (d EDirectory, err error) {
dat := make([]byte, 24)
_, err = r.Read(dat)