List files even when lstat fails (#1382)

Implements a `fakeStat` struct with dummy values and stores the
error in `file.err`, then shows the error instead of FileInfo, if
the file is inaccesible.

Fixes #1359
This commit is contained in:
Jan Tatje authored and GitHub committed 2023-08-26 15:58:48 +03:00
1 parent a280b6c7d3
commit e0abb29a00
2 files changed
+30

No files matched your search

+5
View File
@@ -726,6 +726,11 @@ func (ui *ui) loadFileInfo(nav *nav) {
return
}
if curr.err != nil {
ui.echoerrf("stat: %s", curr.err)
return
}
statfmt := strings.ReplaceAll(gOpts.statfmt, "|", "\x1f")
replace := func(s string, val string) {
if val == "" {