! Opens the file in OpenMode \a mode. This is identical to QFile::open(), with the one exception that the Truncate mode flag is disallowed. Truncation would conflict with the advisory file locking, since the file would be modified before the write lock is obtained. If truncation is required, use resize(0) after obtaining the write lock. Returns true if successful; otherwise false. \sa QFile::op
| 121 | \sa QFile::open(), QFile::resize() |
| 122 | */ |
| 123 | bool LockedFile::open(OpenMode mode) |
| 124 | { |
| 125 | if (mode & QIODevice::Truncate) { |
| 126 | qWarning("QtLockedFile::open(): Truncate mode not allowed."); |
| 127 | return false; |
| 128 | } |
| 129 | return QFile::open(mode); |
| 130 | } |
| 131 | |
| 132 | /*! |
| 133 | Returns \e true if this object has a in read or write lock; |
no outgoing calls