Re-write data fullreader & reader
Moved directory and the rest of the inodes to manual decoding
This commit is contained in:
+14
-14
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user