Ne-Lexa / php-zip

PhpZip is a php-library for extended work with ZIP-archives.
MIT License
491 stars 60 forks source link

Remove ftruncate for saveAsStream #82

Closed mbardelmeijer closed 2 years ago

mbardelmeijer commented 3 years ago
Q A
Bug fix? yes
New feature? no

This PR removed the ftruncate call for the saveAsStream method. Reasoning is that we use the S3 stream wrapper, and would like to write the ZIP to a s3 file. When ftruncate is called on s3 streams, the error is thrown that S3 doesn't support that.

For these cases, where it's always written to a stream, I don't see the need for this truncate method, but I might be mistaken. Open for other improvements here.

mbardelmeijer commented 2 years ago

@Ne-Lexa could you tag a release with this fix? I see it's only merged into develop but not in the 4.x mainline.

Ne-Lexa commented 2 years ago

@mbardelmeijer , OK. Release 4.0.2 is out. Thank you for your contribution.