Starting work on file.

File will be the primary way to interact with squashfs files in the future.
I will be making Files for both reading and writing
This commit is contained in:
Caleb Gardner
2020-11-25 13:20:42 -06:00
parent b28b4ae978
commit 9beca864c3
+24
View File
@@ -0,0 +1,24 @@
package squashfs
import (
"io"
"github.com/CalebQ42/squashfs/internal/directory"
"github.com/CalebQ42/squashfs/internal/inode"
)
//File represents a file within a squashfs. File can be either a file or folder.
type File struct {
Name string
Parent *File
Reader *io.Reader
path string
size uint32
r *Reader
in *inode.Inode
}
func (r *Reader) newFileFromEntry(en *directory.Entry) (f *File, err error) {
f.Name = en.Name
f.in, err = r.getInodeFromEntry(en)
}