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:
@@ -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)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user