Added Reader.ModTime
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"math"
|
"math"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/CalebQ42/squashfs/internal/compression"
|
"github.com/CalebQ42/squashfs/internal/compression"
|
||||||
"github.com/CalebQ42/squashfs/internal/inode"
|
"github.com/CalebQ42/squashfs/internal/inode"
|
||||||
@@ -148,6 +149,11 @@ func NewSquashfsReader(r io.ReaderAt) (*Reader, error) {
|
|||||||
return &rdr, nil
|
return &rdr, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ModTime is the last time the file was modified/created.
|
||||||
|
func (r *Reader) ModTime() time.Time {
|
||||||
|
return time.Unix(int64(r.super.CreationTime), 0)
|
||||||
|
}
|
||||||
|
|
||||||
//ExtractTo tries to extract ALL files to the given path. This is the same as getting the root folder and extracting that.
|
//ExtractTo tries to extract ALL files to the given path. This is the same as getting the root folder and extracting that.
|
||||||
func (r *Reader) ExtractTo(path string) []error {
|
func (r *Reader) ExtractTo(path string) []error {
|
||||||
root, err := r.GetRootFolder()
|
root, err := r.GetRootFolder()
|
||||||
|
|||||||
Reference in New Issue
Block a user