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:
@@ -53,6 +53,9 @@ func (f fileInfo) Mode() fs.FileMode {
|
|||||||
if f.IsDir() {
|
if f.IsDir() {
|
||||||
return fs.FileMode(f.perm | uint32(fs.ModeDir))
|
return fs.FileMode(f.perm | uint32(fs.ModeDir))
|
||||||
}
|
}
|
||||||
|
if f.IsSymlink() {
|
||||||
|
return fs.FileMode(f.perm | uint32(fs.ModeSymlink))
|
||||||
|
}
|
||||||
return fs.FileMode(f.perm)
|
return fs.FileMode(f.perm)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,6 +67,10 @@ func (f fileInfo) IsDir() bool {
|
|||||||
return f.fileType == inode.Dir || f.fileType == inode.EDir
|
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 {
|
func (f fileInfo) Sys() any {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user