| 810 | } |
| 811 | |
| 812 | bool FileAccess::readFile(void* pDestBuffer, qint64 maxLength) |
| 813 | { |
| 814 | bool success = false; |
| 815 | |
| 816 | setStatusText(""); |
| 817 | //Avoid hang on linux for special files. |
| 818 | if(!isNormal()) |
| 819 | return true; |
| 820 | |
| 821 | if(isLocal() || !m_localCopy.isEmpty()) |
| 822 | { |
| 823 | if(open(QIODevice::ReadOnly)) |
| 824 | { |
| 825 | success = interruptableReadFile(pDestBuffer, maxLength); // maxLength == f.read( (char*)pDestBuffer, maxLength ) |
| 826 | close(); |
| 827 | } |
| 828 | } |
| 829 | else |
| 830 | { |
| 831 | success = mJobHandler->get(pDestBuffer, maxLength); |
| 832 | close(); |
| 833 | } |
| 834 | |
| 835 | assert((realFile == nullptr || !realFile->isOpen()) && !tmpFile->isOpen()); |
| 836 | return success; |
| 837 | } |
| 838 | |
| 839 | bool FileAccess::writeFile(const void* pSrcBuffer, qint64 length) |
| 840 | { |