summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authord3fault <d3fault@d3fault.net>2017-11-24 16:07:53 -0700
committerd3fault <d3fault@d3fault.net>2018-01-17 04:32:47 +0000
commit1a4cc8d57b928509a64f9679e5c0e7afaa05cb54 (patch)
tree7748aa4993fca0bf115402e2df4bd7d4d49537db /mkspecs
parent0aecac1dcfd4b8e353e2fc0b0ad06d77b4b125d6 (diff)
Add QIODevice::NewOnly and QIODevice::ExistingOnly OpenMode flags
When QFile::open is called with the NewOnly flag, the call will fail if the file already exists. As usual, if the file does not exist, it will be created. Like QTemporaryFile, there is a guarantee from the operating system that you are not accidentally creating a new file on top of an older file. When QFile::open is called with the ExistingOnly flag, the call will fail if the file does not exist. The ExistingOnly flag only provides new functionality when used with the WriteOnly flag. For ReadOnly it provides no change in functionality, as ReadOnly by itself already never creates. Task-number: QTBUG-52244 Change-Id: I8e3206728f245f95172c225bf297023fb078fc6d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/android-clang/qplatformdefs.h1
-rw-r--r--mkspecs/android-g++/qplatformdefs.h1
-rw-r--r--mkspecs/common/android/qplatformdefs.h1
-rw-r--r--mkspecs/common/posix/qplatformdefs.h1
4 files changed, 4 insertions, 0 deletions
diff --git a/mkspecs/android-clang/qplatformdefs.h b/mkspecs/android-clang/qplatformdefs.h
index b9d987e608..f405c91ecb 100644
--- a/mkspecs/android-clang/qplatformdefs.h
+++ b/mkspecs/android-clang/qplatformdefs.h
@@ -139,6 +139,7 @@
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
+#define QT_OPEN_EXCL O_EXCL
// Directory iteration
#define QT_DIR DIR
diff --git a/mkspecs/android-g++/qplatformdefs.h b/mkspecs/android-g++/qplatformdefs.h
index a0e80629a4..0b92709dd5 100644
--- a/mkspecs/android-g++/qplatformdefs.h
+++ b/mkspecs/android-g++/qplatformdefs.h
@@ -139,6 +139,7 @@
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
+#define QT_OPEN_EXCL O_EXCL
// Directory iteration
#define QT_DIR DIR
diff --git a/mkspecs/common/android/qplatformdefs.h b/mkspecs/common/android/qplatformdefs.h
index 23180c5d3c..f75bc4093b 100644
--- a/mkspecs/common/android/qplatformdefs.h
+++ b/mkspecs/common/android/qplatformdefs.h
@@ -115,6 +115,7 @@
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
+#define QT_OPEN_EXCL O_EXCL
// Directory iteration
#define QT_DIR DIR
diff --git a/mkspecs/common/posix/qplatformdefs.h b/mkspecs/common/posix/qplatformdefs.h
index 90fb90a7e3..3ebc523338 100644
--- a/mkspecs/common/posix/qplatformdefs.h
+++ b/mkspecs/common/posix/qplatformdefs.h
@@ -128,6 +128,7 @@
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
+#define QT_OPEN_EXCL O_EXCL
// Posix extensions to C89
#define QT_FILENO fileno