| author | |
| committer | |
| log | 266730c68904083e0b94edb86a925587b4339600 |
| tree | 4abf53fc54fc746a8060903039297f33f608e6f5 |
| parent | e6ccf23520fb89e56a8a6c1a9c93b07d5177bba5 |
1 files changed, 15 insertions(+), 0 deletions(-)
src/util/funcs.zig+15| ... | ... | @@ -130,3 +130,18 @@ pub fn list_contains_gen(comptime T: type, haystack: *std.ArrayList(T), needle: |
| 130 | 130 | } |
| 131 | 131 | return false; |
| 132 | 132 | } |
| 133 | ||
| 134 | pub fn file_list(dpath: []const u8, list: *std.ArrayList([]const u8)) !void { | |
| 135 | var walk = try std.fs.walkPath(gpa, dpath); | |
| 136 | while (true) { | |
| 137 | if (try walk.next()) |entry| { | |
| 138 | if (entry.kind != .File) { | |
| 139 | continue; | |
| 140 | } | |
| 141 | try list.append(try gpa.dupe(u8, entry.path)); | |
| 142 | } | |
| 143 | else { | |
| 144 | break; | |
| 145 | } | |
| 146 | } | |
| 147 | } |