Skip to content

Commit d2e5a34

Browse files
committed
truncate target file before attempting to write to it
1 parent c8eaea6 commit d2e5a34

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/TUSKit/Files.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ final class Files {
175175
}
176176

177177
let destinationHandle = try FileHandle(forWritingTo: targetLocation)
178+
try destinationHandle.truncate(atOffset: 0)
178179
defer {
179180
try? destinationHandle.close()
180181
}

0 commit comments

Comments
 (0)