mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
std.Build.Cache: remove 'test-filetimestamp.tmp' once timestamp returned
This commit is contained in:
parent
2834b937f1
commit
75ff34db9e
@ -956,11 +956,16 @@ fn hashFile(file: fs.File, bin_digest: *[Hasher.mac_length]u8) !void {
|
||||
|
||||
// Create/Write a file, close it, then grab its stat.mtime timestamp.
|
||||
fn testGetCurrentFileTimestamp() !i128 {
|
||||
var file = try fs.cwd().createFile("test-filetimestamp.tmp", .{
|
||||
const test_out_file = "test-filetimestamp.tmp";
|
||||
|
||||
var file = try fs.cwd().createFile(test_out_file, .{
|
||||
.read = true,
|
||||
.truncate = true,
|
||||
});
|
||||
defer file.close();
|
||||
defer {
|
||||
file.close();
|
||||
fs.cwd().deleteFile(test_out_file) catch {};
|
||||
}
|
||||
|
||||
return (try file.stat()).mtime;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user