| ... | @@ -130,3 +130,18 @@ pub fn list_contains_gen(comptime T: type, haystack: *std.ArrayList(T), needle: | ... | @@ -130,3 +130,18 @@ pub fn list_contains_gen(comptime T: type, haystack: *std.ArrayList(T), needle: |
| 130 | } | 130 | } |
| 131 | return false; | 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 | } |