Properly show symlinks in Mode

Previously they were extracted OK (as symlinks), but shown
as regular files with length 0 when getting the file info.
This commit is contained in:
Anders F Björklund
2025-03-11 18:44:30 +01:00
parent 446f29df70
commit 06d2ef3056
+7
View File
@@ -53,6 +53,9 @@ func (f fileInfo) Mode() fs.FileMode {
if f.IsDir() {
return fs.FileMode(f.perm | uint32(fs.ModeDir))
}
if f.IsSymlink() {
return fs.FileMode(f.perm | uint32(fs.ModeSymlink))
}
return fs.FileMode(f.perm)
}
@@ -64,6 +67,10 @@ func (f fileInfo) IsDir() bool {
return f.fileType == inode.Dir || f.fileType == inode.EDir
}
func (f fileInfo) IsSymlink() bool {
return f.fileType == inode.Sym || f.fileType == inode.ESym
}
func (f fileInfo) Sys() any {
return nil
}