| ... | @@ -956,11 +956,16 @@ fn hashFile(file: fs.File, bin_digest: *[Hasher.mac_length]u8) !void { | ... | @@ -956,11 +956,16 @@ fn hashFile(file: fs.File, bin_digest: *[Hasher.mac_length]u8) !void { |
| 956 | | 956 | |
| 957 | // Create/Write a file, close it, then grab its stat.mtime timestamp. | 957 | // Create/Write a file, close it, then grab its stat.mtime timestamp. |
| 958 | fn testGetCurrentFileTimestamp() !i128 { | 958 | fn testGetCurrentFileTimestamp() !i128 { |
| 959 | var file = try fs.cwd().createFile("test-filetimestamp.tmp", .{ | 959 | const test_out_file = "test-filetimestamp.tmp"; |
| | 960 | |
| | 961 | var file = try fs.cwd().createFile(test_out_file, .{ |
| 960 | .read = true, | 962 | .read = true, |
| 961 | .truncate = true, | 963 | .truncate = true, |
| 962 | }); | 964 | }); |
| 963 | defer file.close(); | 965 | defer { |
| | 966 | file.close(); |
| | 967 | fs.cwd().deleteFile(test_out_file) catch {}; |
| | 968 | } |
| 964 | | 969 | |
| 965 | return (try file.stat()).mtime; | 970 | return (try file.stat()).mtime; |
| 966 | } | 971 | } |