| 88 | // }; |
| 89 | |
| 90 | bool readLonglink(QIODevice* in, qint64 size, QByteArray& longlink) |
| 91 | { |
| 92 | qint64 n = 0; |
| 93 | size--; // ignore trailing null |
| 94 | if (size < 0) { |
| 95 | qCritical() << "The filename size is negative"; |
| 96 | return false; |
| 97 | } |
| 98 | longlink.resize(size + (BLOCKSIZE - size % BLOCKSIZE)); // make the size divisible by BLOCKSIZE |
| 99 | for (qint64 offset = 0; offset < longlink.size(); offset += BLOCKSIZE) { |
| 100 | n = in->read(longlink.data() + offset, BLOCKSIZE); |
| 101 | if (n != BLOCKSIZE) { |
| 102 | qCritical() << "The expected blocksize was not respected for the name"; |
| 103 | return false; |
| 104 | } |
| 105 | } |
| 106 | longlink.truncate(qstrlen(longlink.constData())); |
| 107 | return true; |
| 108 | } |
| 109 | |
| 110 | int getOctal(char* buffer, int maxlenght, bool* ok) |
| 111 | { |