Skip to content

Unable To Extract GNU Tar With Overwrite false #160

@freshleafmedia

Description

@freshleafmedia

When attempting to extract a TAR archive using GNU Tar v1.30 when not overwriting an exception is raised:

$zippy = Zippy::load();
$archive = $zippy->open($archiveFilename);
$archive->extract(sys_get_temp_dir());
Alchemy\Zippy\Exception\RuntimeException
Unable to execute the following command '/usr/bin/tar' '-k' '--extract' '--file=/tmp/batch24e617b535.tar.gz' '--overwrite' '--gzip' '--directory' '/tmp' './14d2b6beb1.json' {output: /usr/bin/tar: '--overwrite' cannot be used with '--keep-old-files'
Try '/usr/bin/tar --help' or '/usr/bin/tar --usage' for more information.

I believe the problem stems from the default options for GNU Tar including --overwrite which conflicts with -k (or --keep-old-files) which is added by default

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