Skip to content

Commit

Permalink
use zip.File.Modified
Browse files Browse the repository at this point in the history
  • Loading branch information
ungerik committed Aug 14, 2023
1 parent b51c86d commit 57d713a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zipfs/zipfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (zipfs *ZipFileSystem) stat(filePath string, zipFile *zip.File, isDir bool)
IsRegular: true,
IsHidden: len(name) > 0 && name[0] == '.',
Size: size,
ModTime: zipFile.ModTime(),
ModTime: zipFile.Modified,
Permissions: fs.AllRead,
}
return info.StdFileInfo(), nil
Expand Down Expand Up @@ -274,9 +274,9 @@ func (zipfs *ZipFileSystem) ListDirInfoRecursive(ctx context.Context, dirPath st
parts := strings.Split(file.Name, Separator)
lastIndex := len(parts) - 1
for i := 0; i < lastIndex; i++ {
currentDir = currentDir.addChildDir(parts[i], file.ModTime())
currentDir = currentDir.addChildDir(parts[i], file.Modified)
}
currentDir.addChildFile(parts[lastIndex], file.ModTime(), int64(file.UncompressedSize64))
currentDir.addChildFile(parts[lastIndex], file.Modified, int64(file.UncompressedSize64))
}

if dirPath != "" && dirPath != "." && dirPath != Separator {
Expand Down

0 comments on commit 57d713a

Please sign in to comment.