aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-12-03 20:37:43 -0800
committerAndrew Kelley <andrew@ziglang.org>2025-12-23 22:15:07 -0800
commitd1d2c37af26902f953b2b72335b326c4b01e3bb2 (patch)
treeff74335c6b9eda252c6c4970d49f36bd6f904537 /lib/std/Build.zig
parent81214278ca14b832e53876feb70fa3c072c14dd6 (diff)
downloadzig-d1d2c37af26902f953b2b72335b326c4b01e3bb2.tar.gz
zig-d1d2c37af26902f953b2b72335b326c4b01e3bb2.zip
std: all Dir functions moved to std.Io
Diffstat (limited to 'lib/std/Build.zig')
-rw-r--r--lib/std/Build.zig7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/std/Build.zig b/lib/std/Build.zig
index 50a2804938..fcd94ce134 100644
--- a/lib/std/Build.zig
+++ b/lib/std/Build.zig
@@ -1700,9 +1700,8 @@ pub fn addCheckFile(
}
pub fn truncateFile(b: *Build, dest_path: []const u8) (fs.Dir.MakeError || fs.Dir.StatFileError)!void {
- if (b.verbose) {
- log.info("truncate {s}", .{dest_path});
- }
+ const io = b.graph.io;
+ if (b.verbose) log.info("truncate {s}", .{dest_path});
const cwd = fs.cwd();
var src_file = cwd.createFile(dest_path, .{}) catch |err| switch (err) {
error.FileNotFound => blk: {
@@ -1713,7 +1712,7 @@ pub fn truncateFile(b: *Build, dest_path: []const u8) (fs.Dir.MakeError || fs.Di
},
else => |e| return e,
};
- src_file.close();
+ src_file.close(io);
}
/// References a file or directory relative to the source root.