Starting work on ExtractTo from File
When using ExtractTo, will automatically set the correct permissions Will also be able to extract folders
This commit is contained in:
@@ -3,6 +3,7 @@ package squashfs
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/CalebQ42/squashfs/internal/directory"
|
||||
@@ -173,6 +174,20 @@ func (f *File) GetSymlinkFile() *File {
|
||||
return f.r.GetFileAtPath(f.SymlinkPath())
|
||||
}
|
||||
|
||||
//Permission returns the os.FileMode of the File. Currently only has the permission bits (the last 9) populated.
|
||||
func (f *File) Permission() os.FileMode {
|
||||
//TODO: possibly populate more os.FileMode bits
|
||||
return os.FileMode(f.in.Header.Permissions)
|
||||
}
|
||||
|
||||
func (f *File) ExtractTo(path string) error {
|
||||
if f.IsDir() {
|
||||
//TODO
|
||||
} else if f.IsSymlink() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//Close frees up the memory held up by the underlying reader. Should NOT be called when writing.
|
||||
//When reading, Close is safe to use, but any subsequent Read calls resets to the beginning of the file.
|
||||
func (f *File) Close() error {
|
||||
|
||||
Reference in New Issue
Block a user