Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Zip doesn't create when removing source directory after zip make #19

Closed
TedAvery opened this issue Sep 11, 2014 · 2 comments
Closed

Zip doesn't create when removing source directory after zip make #19

TedAvery opened this issue Sep 11, 2014 · 2 comments

Comments

@TedAvery
Copy link

I can successfully ZIP a folder of files. The problem is that when I try to delete the source directory after creating the ZIP (line 4 below), the ZIP doesn't get created. Is there a way to ensure the ZIP has been finalised before I delete the source directory?

$batch_path = storage_path().$this->batch_base.'/'.$batch_name;
$zip_path = 'downloads/invoices/'.$batch_name.'.zip';
Zipper::make($zip_path)->add($batch_path);
File::deleteDirectory($batch_path);
@Chumper
Copy link
Owner

Chumper commented Sep 11, 2014

try with close() at the end, this should flush the changes to the file system.

@TedAvery
Copy link
Author

Yep that did it. Sorry, somehow I overlooked that in the documentation. Thanks a lot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants