Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.
This repository was archived by the owner on May 26, 2022. It is now read-only.

Is it possible to use wb instead of wb+ fopen mode in openToFile() in AbstractWriter in order to use compress.zlib:// ? #881

@cmanley

Description

@cmanley

If I try to write to a compressed CSV file, then I get an exception using the file wrapper compress.zlib://

I think it has to do with the seekable file mode used here:
$this->filePointer = $this->globalFunctionsHelper->fopen($this->outputFilePath, 'wb+');

Simply removing the + from the file mode seems to solve the problem but I'm not sure if box/spout needs it somewhere for something.

B.t.w. this is the exception and errors I get when I open a file with a compress.zlib wrapper using the latest v2 release:

PHP Warning:  fopen(compress.zlib://art.csv.gz): failed to open stream: operation failed in lib/box/spout/src/Spout/Common/Helper/GlobalFunctionsHelper.php on line 25
PHP Fatal error:  Uncaught Box\Spout\Common\Exception\IOException: File pointer has not be opened in lib/box/spout/src/Spout/Writer/AbstractWriter.php:175

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions