View Issue Details

IDProjectCategoryView StatusLast Update
0035211FPCPackagespublic2019-03-09 15:59
ReporterPythonAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWindowsOSWindowsOS VersionXP
Product Version3.0.4Product Buildlatest 
Target Version3.2.0Fixed in Version3.3.1 
Summary0035211: ZIP archive cannot be unpacked, while other app holds it opened for read
DescriptionXLSX files (Microsoft Excel 2007) is a regular ZIP archive, that can be easily opened with paszlib. But when this file is opened for READING by Excel (or Lible/OpenCalc), unzOpen returns nil. That happened, because share violation occured: Excel/Calc holds file with fmShareDenyWrite but unzOpen expects fmShareExclusive access.
Steps To Reproduce1. Take any XLSX file.
2. Use unzOpen. This opens file successfully (not nil will be returned).
3. Close application and open XLSX file with Excel or OpenCalc.
4. Try to open the same file with unzOpen. File wont't be opened, nil will be returned.
Additional InformationHow to fix:
in file:
https://github.com/graemeg/freepascal/blob/master/packages/paszlib/src/ziputils.pas
in function fopen in lines, that appears like:
 fopenread: fp := TFileStream.Create(strpas(filename), fmOpenRead);
add after fmOpenRead option: "or fmShareDenyWrite". This allows opening file in shareable read mode.
Tagsaccess, unzip
Fixed in Revision41648
FPCOldBugId
FPCTarget
Attached Files

Activities

Michael Van Canneyt

2019-03-09 15:59

administrator   ~0114741

Fixed as proposed, thanks for reporting!

Issue History

Date Modified Username Field Change
2019-03-09 06:42 Python New Issue
2019-03-09 06:43 Python Tag Attached: access
2019-03-09 06:43 Python Tag Attached: unzip
2019-03-09 15:59 Michael Van Canneyt Fixed in Revision => 41648
2019-03-09 15:59 Michael Van Canneyt Note Added: 0114741
2019-03-09 15:59 Michael Van Canneyt Status new => resolved
2019-03-09 15:59 Michael Van Canneyt Fixed in Version => 3.3.1
2019-03-09 15:59 Michael Van Canneyt Resolution open => fixed
2019-03-09 15:59 Michael Van Canneyt Assigned To => Michael Van Canneyt
2019-03-09 15:59 Michael Van Canneyt Target Version => 3.2.0