\note To create a valid link on Windows, \a linkName must have a \c{.lnk} file extension.
- \note Symbian filesystem does not support links.
-
\sa setFileName()
*/
{
Q_D(QFile);
unsetError();
- if (openMode() == QIODevice::NotOpen) {
+ if (!isOpen()) {
d->setError(QFile::PermissionsError, qt_error_string(EACCES));
return 0;
}
// If we know the mapping will extend beyond EOF, fail early to avoid
// undefined behavior. Otherwise, let mmap have its say.
if (d->doStat(QFileSystemMetaData::SizeAttribute)
- && (QT_OFF_T(size) > d->metaData.size() - QT_OFF_T(offset)))
+ && (QT_OFF_T(size) > d->metaData.size() - QT_OFF_T(offset))) {
qWarning("QFile::map: Mapping a file beyond its size is not portable");
+ }
int access = 0;
if (openMode() & QIODevice::ReadOnly) access |= PROT_READ;
void QFile::unsetError()
{
Q_D(QFile);
- d->setError(QFile::NoError, QString());
+ d->error = QFile::NoError;
+ d->errorString.clear();
}
#ifndef QT_NO_QOBJECT