Skip to content

Commit cfb9ad1

Browse files
authored
Fix silent-overwrite behavior of FileManager.copyItem() on Windows
1 parent 6aa0ee4 commit cfb9ad1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Sources/Foundation/FileManager+Win32.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ extension FileManager {
550550
internal func _copyRegularFile(atPath srcPath: String, toPath dstPath: String, variant: String = "Copy") throws {
551551
try withNTPathRepresentation(of: srcPath) { wszSource in
552552
try withNTPathRepresentation(of: dstPath) { wszDestination in
553-
if !CopyFileW(wszSource, wszDestination, false) {
553+
if !CopyFileW(wszSource, wszDestination, true) {
554554
throw _NSErrorWithWindowsError(GetLastError(), reading: true, paths: [srcPath, dstPath])
555555
}
556556
}

0 commit comments

Comments
 (0)