space: 32-bit builds — stat fields are int32 there

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Mitchell-Johnson
2026-09-22 20:19:19 -07:00
co-authored by Claude Fable 5.1
parent fc5236471e
commit 41e63f74e9
+6 -6
View File
@@ -90,7 +90,7 @@ func Walk(ctx context.Context, roots []string, progress func(Progress)) (*Node,
if err := syscall.Lstat(r, &st); err != nil || st.Mode&syscall.S_IFMT != syscall.S_IFDIR {
continue
}
n := &Node{Name: filepath.Base(r), Dir: true, MTime: st.Mtim.Sec}
n := &Node{Name: filepath.Base(r), Dir: true, MTime: int64(st.Mtim.Sec)}
if r == "/" {
n = root
}
@@ -211,7 +211,7 @@ func (w *walker) readDir(j job) {
}
switch st.Mode & syscall.S_IFMT {
case syscall.S_IFDIR:
c := &Node{Name: name, Dir: true, MTime: st.Mtim.Sec}
c := &Node{Name: name, Dir: true, MTime: int64(st.Mtim.Sec)}
j.node.Children = append(j.node.Children, c)
if uint64(st.Dev) != j.dev {
c.Mount = true // something else is mounted here; if it is this disk's too, it is a root of its own
@@ -219,15 +219,15 @@ func (w *walker) readDir(j job) {
}
w.push(job{path: p, node: c, dev: j.dev})
case syscall.S_IFREG, syscall.S_IFLNK:
alloc := st.Blocks * 512
alloc := int64(st.Blocks) * 512
w.files.Add(1)
w.bytes.Add(alloc)
if alloc >= KeepMin || st.Size >= KeepMin {
j.node.Children = append(j.node.Children, &Node{Name: name, Size: alloc, Apparent: st.Size, MTime: st.Mtim.Sec})
if alloc >= KeepMin || int64(st.Size) >= KeepMin {
j.node.Children = append(j.node.Children, &Node{Name: name, Size: alloc, Apparent: int64(st.Size), MTime: int64(st.Mtim.Sec)})
} else {
j.node.SmallN++
j.node.SmallSize += alloc
j.node.Apparent += st.Size // added to the directory's own apparent total below
j.node.Apparent += int64(st.Size) // added to the directory's own apparent total below
}
}
}