On 20 February 2015 at 22:13, Lubomir I. Ivanov <[email protected]> wrote: > but...after building Subsurface with the new libzip it gives me > "Archive cannot be opened. Bad file descriptor" when download from > divelogs.de. > i need to investigate. >
spent a couple of hours on this one. CCing Thiago - the QTemporaryFile file locks in a way that the new libzip WINAPI support cannot use zip_open() on said file. could this be a LockFile / UnlockFile() API related semantic in Qt 5.3.0? or am i missing something else? i had to rename() the file to fix the error before calling zip_open(), which is strange (patch attached). the new libzip itself works. but i also sent an email to the libzip ML, as this could be on their end for some odd reason. i'm pretty sure it used to work at some point with my Qt 5.3.0 setup, but that was with the old libzip.dll. trying to figure out what is happening. commit message: ----------------------- Subject: [PATCH] Divelogs.de: fix broken download due to an exclusive access lock The current divelogs.de download doesn't work for Win7, Qt5.2 (or at least for a particular test setup). When a divelogs.de download happens 'zipFile' (which is a QTemporaryFile) is written to with full permissions in the TEMP folder. The location and random file name are OK. Once DivelogsDeWebServices::downloadFinished() is reached 'zipFile' can be closed, it can be renamed and copied from the process. External processes cannot read it which is understandable as it may be locked by the process (for QTemporaryFile to delete it later), but libzip.dll also can't read it via zip_open(). Doing a close() doesn't unlock the file, but a rename() does. By prefixing the filename with a "_" the lock is gone and we can read the file via zip_open(). The file is later deleted once the process ends. ----------------------- lubomir --
0001-Divelogs.de-fix-broken-download-due-to-an-exclusive-.patch
Description: Binary data
_______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
