keeru
keeru

Reputation: 87

open3: exec of failed at perl 5.18.2

I wrote perl script for zipping the files with Archive::SevenZip module.

I got this error

open3: exec of 7z -y -bd l -slt "Filelocation" failed at /usr/local/share/perl/5.18.2/Archive/SevenZip.pm.

I can't able to resolve that.

Upvotes: 0

Views: 739

Answers (1)

ikegami
ikegami

Reputation: 386551

Archive::SevenZip is using open3 to execute the command-line utility 7z. That message indicates the call to exec is failing.

Most likely problem: 7z isn't installed on your machine.

If you think that's not the problem,

  1. Edit the file named by perldoc -lm IPC::Open3.
  2. Replace

    exec @cmd or do {
        carp "$Me: exec of @cmd failed";
    

    with

    exec @_ or do {
        local($")=(" ");
        croak "$Me: exec of @_ failed: $!";
    };
    

    (This change is already present in newer versions of IPC::Open3.)

  3. Rerun the program.
  4. Provide the more detailed error message.

Upvotes: 2

Related Questions