Very simple:
1) pBuffer is char array (65535) long
2) file on disk is 8589 bytes
3) read returns -1 so qFatal in the tiny example gets executed - but why? If another value is put there, 20000 for example works (Size == 8589), 50000 returns -1 
qDebug() << "Fail";
return false;
}
qint64 Size = read(pBuffer, 65535); // The maximum number (looks like a hard number) what works is 38002
if (Size == -1) {
qFatal("Why?");
}
QFile File("myfile");
if (File.open(QIODevice::ReadOnly)) {
qDebug() << "Fail";
return false;
}
qint64 Size = read(pBuffer, 65535); // The maximum number (looks like a hard number) what works is 38002
if (Size == -1) {
qFatal("Why?");
}
To copy to clipboard, switch view to plain text mode
Bookmarks