authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-07-14 17:10:59 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-07-14 17:10:59 -07:00
log0cbac546245ed1445a2892dbca662b632b11eb9f
tree8397d56ff118d73df107631f2cb844396bf8a036
parentca8682fcc342b4ee9b2673b3d298d8d88ff8664f

dirSize/fileSize: match return type to std.fs.Stat.size


1 files changed, 3 insertions(+), 3 deletions(-)

src/lib.zig+3-3
......@@ -118,8 +118,8 @@ pub fn fileList(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]string {
118118 return list.toOwnedSlice();
119119}
120120
121pub fn dirSize(alloc: std.mem.Allocator, dir: std.fs.Dir) !usize {
122 var res: usize = 0;
121pub fn dirSize(alloc: std.mem.Allocator, dir: std.fs.Dir) !u64 {
122 var res: u64 = 0;
123123
124124 var walk = try dir.walk(alloc);
125125 defer walk.deinit();
......@@ -130,7 +130,7 @@ pub fn dirSize(alloc: std.mem.Allocator, dir: std.fs.Dir) !usize {
130130 return res;
131131}
132132
133pub fn fileSize(dir: std.fs.Dir, sub_path: string) !usize {
133pub fn fileSize(dir: std.fs.Dir, sub_path: string) !u64 {
134134 const f = try dir.openFile(sub_path, .{});
135135 defer f.close();
136136 const s = try f.stat();