| ... | ... | @@ -263,10 +263,7 @@ pub const File = struct { |
| 263 | 263 | fs.base64_encoder.encode(&random_sub_path, &random_bytes); |
| 264 | 264 | const tmp_file_name = try mem.join(base.allocator, "_", &[_][]const u8{ emit.sub_path, random_sub_path[0..] }); |
| 265 | 265 | defer base.allocator.free(tmp_file_name); |
| 266 | | var tmp_file = try emit.directory.handle.createFile(tmp_file_name, .{ .mode = determineMode(base.options) }); |
| 267 | | defer tmp_file.close(); |
| 268 | | const stat = try f.stat(); |
| 269 | | _ = try f.copyRangeAll(0, tmp_file, 0, stat.size); |
| 266 | try emit.directory.handle.copyFile(emit.sub_path, emit.directory.handle, tmp_file_name, .{}); |
| 270 | 267 | try emit.directory.handle.rename(tmp_file_name, emit.sub_path); |
| 271 | 268 | } |
| 272 | 269 | f.close(); |