]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/file_resume_data.go
Account for the root
[rbdr/mobius] / hotline / file_resume_data.go
index f5b82ded971f41ce8dc989a689c8c3d0ef5df228..5dfd2d81dac2cb8a1b48a14eb02ad91afdc29021 100644 (file)
@@ -12,6 +12,8 @@ type FileResumeData struct {
        RSVD         [34]byte // Unused
        ForkCount    [2]byte  // Length of ForkInfoList.  Either 2 or 3 depending on whether file has a resource fork
        ForkInfoList []ForkInfoList
+
+       //readOffset int // TODO
 }
 
 type ForkInfoList struct {
@@ -40,6 +42,31 @@ func NewFileResumeData(list []ForkInfoList) *FileResumeData {
        }
 }
 
+//
+//func (frd *FileResumeData) Read(p []byte) (int, error) {
+//     buf := slices.Concat(
+//             frd.Format[:],
+//             frd.Version[:],
+//             frd.RSVD[:],
+//             frd.ForkCount[:],
+//     )
+//     for _, fil := range frd.ForkInfoList {
+//             buf = append(buf, fil...)
+//             _ = binary.Write(&buf, binary.LittleEndian, fil)
+//     }
+//
+//     var buf bytes.Buffer
+//     _ = binary.Write(&buf, binary.LittleEndian, frd.Format)
+//     _ = binary.Write(&buf, binary.LittleEndian, frd.Version)
+//     _ = binary.Write(&buf, binary.LittleEndian, frd.RSVD)
+//     _ = binary.Write(&buf, binary.LittleEndian, frd.ForkCount)
+//     for _, fil := range frd.ForkInfoList {
+//             _ = binary.Write(&buf, binary.LittleEndian, fil)
+//     }
+//
+//     return buf.Bytes(), nil
+//}
+
 func (frd *FileResumeData) BinaryMarshal() ([]byte, error) {
        var buf bytes.Buffer
        _ = binary.Write(&buf, binary.LittleEndian, frd.Format)