C++ (Qt)bool QFSFileEngine::open(QIODevice::OpenMode openMode){ Q_D(QFSFileEngine); if (d->filePath.isEmpty()) { qWarning("QFSFileEngine::open: No file name specified"); setError(QFile::OpenError, QLatin1String("No file name specified")); return false; } // Append implies WriteOnly. if (openMode & QFile::Append) openMode |= QFile::WriteOnly; // WriteOnly implies Truncate if neither ReadOnly nor Append are sent. if ((openMode & QFile::WriteOnly) && !(openMode & (QFile::ReadOnly | QFile::Append))) openMode |= QFile::Truncate; d->openMode = openMode; d->lastFlushFailed = false; d->tried_stat = 0; d->fh = 0; d->fd = -1; return d->nativeOpen(openMode);}