From 39524318aae56244a3b19c0edc3c2f2aafb623a6 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 13 Apr 2015 22:06:01 +0300 Subject: [PATCH] CopyFile improved --- Utilities/rFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/rFile.cpp b/Utilities/rFile.cpp index 70e1dea34e..e38e6d2b62 100644 --- a/Utilities/rFile.cpp +++ b/Utilities/rFile.cpp @@ -163,7 +163,7 @@ int OSCopyFile(const char* source, const char* destination, bool overwrite) { return -1; } - if ((output = open(destination, O_RDWR | O_CREAT | (overwrite ? 0 : O_EXCL), 0666)) == -1) + if ((output = open(destination, O_WRONLY | O_CREAT | (overwrite ? O_TRUNC : O_EXCL), 0666)) == -1) { close(input); return -1;