[Bug 291374] Cannot open DOCX document: "Could not read the beginning of the file"

Sebastian Sauer sebsauer at kdab.com
Wed Mar 7 04:12:55 UTC 2012


https://bugs.kde.org/show_bug.cgi?id=291374

--- Comment #10 from Sebastian Sauer <sebsauer at kdab.com> ---
I think the reason could be that the temporary file is still open. Windows
cannot rename files that are opened at least afaik. The problem is that
KTemporaryFile/QTemporaryFile::close() does *NOT* close the
file/file-descriptor;

bool QTemporaryFileEngine::close()
{
    // Don't close the file, just seek to the front.
    seek(0);
    setError(QFile::UnspecifiedError, QString());
    return true;
}

What means that the temporary file will stay open as long as it's used making
it impossible to rename it during it's lifetime and when it's actually closed
it#s to late cause it's autoRemove'd means deleted :-/

Does that make sense?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Kde-windows mailing list