QFileSystemMetaData &metaData)
{
QByteArray mode;
- if ((flags & QIODevice::ReadOnly) && !(flags & QIODevice::Truncate)) {
+ if (flags & QIODevice::Append) {
+ mode = "ab";
+ if (flags & QIODevice::ReadOnly)
+ mode += '+';
+ } else if ((flags & QIODevice::ReadOnly) && !(flags & QIODevice::Truncate)) {
mode = "rb";
if (flags & QIODevice::WriteOnly) {
metaData.clearFlags(QFileSystemMetaData::FileType);
if (flags & QIODevice::ReadOnly)
mode += '+';
}
- if (flags & QIODevice::Append) {
- mode = "ab";
- if (flags & QIODevice::ReadOnly)
- mode += '+';
- }
#if defined(__GLIBC__)
// must be glibc >= 2.7
*/
static inline int openModeToOpenFlags(QIODevice::OpenMode mode)
{
- int oflags = QT_OPEN_RDONLY;
#ifdef QT_LARGEFILE_SUPPORT
- oflags |= QT_OPEN_LARGEFILE;
+ int oflags = QT_OPEN_RDONLY | QT_OPEN_LARGEFILE;
+#else
+ int oflags = QT_OPEN_RDONLY;
#endif
if ((mode & QFile::ReadWrite) == QFile::ReadWrite) {