commit caac65aae74a15bf81cf306419b50f7d45dea444
parent 98774defa0496b92243c1b542f68f33465a0a6eb
Author: Matsuda Kenji <info@mtkn.jp>
Date: Sat, 19 Oct 2024 20:45:33 +0900
add directory flag for permString
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/stat.go b/stat.go
@@ -9,9 +9,12 @@ import (
type FileMode = fs.FileMode
// PermString returns the string representation of perm's
-// lower 9 bits for debugging.
+// lower 9 bits and DMDIR bit.
func permString(perm FileMode) string {
s := ""
+ if perm&fs.ModeDir != 0 {
+ s += "d"
+ }
for i := 6; i >= 0; i -= 3 {
p := perm >> i
if p&4 != 0 {