also looking at this
test: make CI exercise maintained integrations
#18
16 files
+390
-139
| @@ -172,6 +172,20 @@ pub fn deleteFile(allocator: std.mem.Allocator, path: []const u8) !void { | ||
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | /// Delete an empty directory using POSIX APIs. | |
| 176 | /// Replaces std.fs.cwd().deleteDir(). | |
| 177 | pub fn deleteDir(allocator: std.mem.Allocator, path: []const u8) !void { | |
| 178 | const path_z = try allocator.dupeSentinel(u8, path, 0); | |
| 179 | defer allocator.free(path_z); | |
| 180 | const rc = std.c.rmdir(path_z); | |
| 181 | if (rc != 0) { | |
| 182 | switch (std.c.errno(rc)) { | |
| 183 | .NOENT => return error.FileNotFound, | |
| 184 | else => return error.Unexpected, | |
| 185 | } | |
| 186 | } | |
| 187 | } | |
| 188 | ||
| 175 | 189 | /// Create directories recursively using POSIX APIs. |
| 176 | 190 | /// Replaces std.fs.cwd().makePath(). |
| 177 | 191 | pub fn makePath(allocator: std.mem.Allocator, path: []const u8) !void { |