Re: odd ZipArchive error
| From: | Christoph Becker | Date: | Wed, 22 Apr 2015 14:26:55 +0000 |
| Subject: | Re: odd ZipArchive error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-324819@lists.php.net to get a copy of this message | ||
Jeffry Killen wrote:
> I am getting an odd ZipArchive::open error.
> I don't really understand this error, let alone why I am getting it.
>
> This is all I can find in the online manual.
>
> ZipArchive::ER_MULTIDISK (integer)
> Multi-disk zip archives not supported.
>
> all the files referenced are on the same disc at or below the "home
> dir", in this
> case '/<path>/dev_lab';
>
> I am developing on a Mac OSX Yosemite/Apache/php v5.5x. The machine is
> a multi core intel processor, but what would that have to do with it?
> All the dev activity is in the Apache document root directory.
Multi-disk means that the archive is split into multiple files which can
be put on small storage devices. This option was typically used when
data was transferred via floppy disks -- not an issue nowadays.
> This is what my code is trying to do, essentially;
>
>
> $_name = /<path>/dev_lab/dist/new.zip
> $_retStr = self::$_zipper->open($_name, ZIPARCHIVE::CREATE);
What happens when you delete the file before opening it? I can imagine
that there is something wrong with new.zip, so the error is returned.
> So this was picked up in code because ZipArchive::close comes up false;
>
> But close is supposed to be called automatically, so why would it be
> necessary
> to call close explicitly in order to get the return value of open? My
> code tests
> for a return value of open before testing for the return value of close.
> It does
> not see a return value for open, but sees a false value for close and
> presents the
> error code returned by open.
Hmm, which method call did return ER_MULTIDISK? ZipArchive::open() or
ZipArchive::close(). The latter method is supposed to return a boolean
value. (int) TRUE is 1, what is the value of ZipArchive::ER_MULTIDISK.
So perhaps just a misinterpretation of the return value?
--
Christoph M. Becker