issue with zip fopen/CloseHandle
C++ library for creating XLSX files for MS Excel 2007 and above.
Brought to you by:
oxod,
programmeralex
Hi,
looks like zip does not close file if it was open using handle from fopen on Windows. Probably it should be fopen/fclose pair, not fopen/CloseHandle.
It is near line 2532 in zip.cpp file.
Regards.
Hi,
I apologize for the long silence, I had problems accessing the site.
Why did you decide that zip does not close file if it was open using handle from fopen on Windows?
I tried such a simple test:
When the program is in an infinite loop, the file "Test.xlsx" looks closed. I can open it in Excel or delete it.
Tested on Windows 10 Pro 21H1 with MinGW 7.3.0 32-bit for C++.
Hi,
in my case it looked like this: I am using software which produced xlsx reports. During one session it might be generated something like 5-10 files. They might be opened in Excel, but cannot be saved because "someone else also opened them". After I close software, this problem disappears. If I'm using "book.Save( f, false )" and closing reports separately, by fclose, it also do not appear.
I'm tested it with Win10 Pro 21H1, gcc 12.1 MinGW_w64 v10 UCRT 32bit (https://winlibs.com/).
OS-related difference is that I saved reports on network drive.
Hi,
Sorry for the long silence for various reasons.
Perhaps is the problem related to antivirus software or similar security software?
Just in case, I redesigned the library to call the fclose function directly. Please check if possible.
Hi,
I tried new version, very briefly. It looks like that this problem fixed. Thanks!
I also suggest to add Scratch to CMake. Practically there are no reasons to keep it separately.
Hi,
Done :-) Thanks for your help!