diff --git a/src/core/copyjob.cpp b/src/core/copyjob.cpp --- a/src/core/copyjob.cpp +++ b/src/core/copyjob.cpp @@ -1598,6 +1598,7 @@ Q_Q(CopyJob); bool bCopyFile = false; qCDebug(KIO_COPYJOB_DEBUG); + const auto fileSystem = KFileSystemType::fileSystemType(m_globalDest.toString()); // Take the first file in the list QList::Iterator it = files.begin(); // Is this URL on the skip list ? @@ -1617,7 +1618,13 @@ q->emitResult(); return; } - //TODO check if dst mount is msdos and (*it).size exceeds it's limits + + if (fileSystem == KFileSystemType::Fat && (*it).size > 4294967296) { // 4 GB = 4294967296 Bytes + q->setError(ERR_FILE_TOO_LARGE_FOR_FAT32); + q->setErrorText(m_globalDest.toDisplayString()); + q->emitResult(); + return; + } } const QUrl &uSource = (*it).uSource; diff --git a/src/core/global.h b/src/core/global.h --- a/src/core/global.h +++ b/src/core/global.h @@ -245,7 +245,8 @@ ERR_DROP_ON_ITSELF = KJob::UserDefinedError + 70, ///< from KIO::DropJob, @since 5.6 ERR_CANNOT_MOVE_INTO_ITSELF = KJob::UserDefinedError + 71, ///< emitted by KIO::move, @since 5.18 ERR_PASSWD_SERVER = KJob::UserDefinedError + 72, ///< returned by SlaveBase::openPasswordDialogV2, @since 5.24 - ERR_CANNOT_CREATE_SLAVE = KJob::UserDefinedError + 73 ///< used by Slave::createSlave, @since 5.30 + ERR_CANNOT_CREATE_SLAVE = KJob::UserDefinedError + 73, ///< used by Slave::createSlave, @since 5.30 + ERR_FILE_TOO_LARGE_FOR_FAT32 = KJob::UserDefinedError + 74 }; /** diff --git a/src/core/job_error.cpp b/src/core/job_error.cpp --- a/src/core/job_error.cpp +++ b/src/core/job_error.cpp @@ -245,8 +245,12 @@ case KIO::ERR_CANNOT_CREATE_SLAVE: result = i18n("Unable to create io-slave. %1", errorText); break; + case KIO::ERR_FILE_TOO_LARGE_FOR_FAT32: + result = i18n("The file named %1 cannot be transferred because its size is greater than 4 GB," + " and the destination's filesystem does not support files that large.", errorText); + break; default: - result = i18n("Unknown error code %1\n%2\nPlease send a full bug report at https://bugs.kde.org.", errorCode, errorText); + result = i18n("Unknown error code %1\n%2\nPlease send a full bug report at http://bugs.kde.org.", errorCode, errorText); break; }