diff --git a/internal/space/walk.go b/internal/space/walk.go index c63d748..e1f3541 100644 --- a/internal/space/walk.go +++ b/internal/space/walk.go @@ -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 } } }