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 {...@@ -118,8 +118,8 @@ pub fn fileList(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]string {
118 return list.toOwnedSlice();118 return list.toOwnedSlice();
119}119}
120120
121pub fn dirSize(alloc: std.mem.Allocator, dir: std.fs.Dir) !usize {121pub fn dirSize(alloc: std.mem.Allocator, dir: std.fs.Dir) !u64 {
122 var res: usize = 0;122 var res: u64 = 0;
123123
124 var walk = try dir.walk(alloc);124 var walk = try dir.walk(alloc);
125 defer walk.deinit();125 defer walk.deinit();
...@@ -130,7 +130,7 @@ pub fn dirSize(alloc: std.mem.Allocator, dir: std.fs.Dir) !usize {...@@ -130,7 +130,7 @@ pub fn dirSize(alloc: std.mem.Allocator, dir: std.fs.Dir) !usize {
130 return res;130 return res;
131}131}
132132
133pub fn fileSize(dir: std.fs.Dir, sub_path: string) !usize {133pub fn fileSize(dir: std.fs.Dir, sub_path: string) !u64 {
134 const f = try dir.openFile(sub_path, .{});134 const f = try dir.openFile(sub_path, .{});
135 defer f.close();135 defer f.close();
136 const s = try f.stat();136 const s = try f.stat();