skip copying files only when there is a data path
This commit is contained in:
parent
bf1f01b9bf
commit
6bbd9e7b28
3
file.go
3
file.go
@ -80,9 +80,12 @@ func (file *File) Seek(offset int64, whence int) (int64, error) {
|
||||
|
||||
func (file *File) export(targetDir string) error {
|
||||
targetPath := filepath.Join(targetDir, file.sourcePath)
|
||||
|
||||
if len(file.dataPath) == 0 {
|
||||
if targetInfo, err := os.Stat(targetPath); err == nil && targetInfo.ModTime().After(file.ModTime()) {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(path.Dir(targetPath), 0755); err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user