0

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.

choroba
  • 231,213
  • 25
  • 204
  • 289
keeru
  • 87
  • 6

1 Answers1

2

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.
ikegami
  • 367,544
  • 15
  • 269
  • 518
  • I checked the changes are already in my system. i installed 7z in my machine."Unexpected line in 7zip output, hope that's OK: [] at /usr/local/share/perl/5.18.2/Archive/SevenZip.pm line 256, line 7." still got this error. And the line in the file is "if( $output[0] =~ /^----------\s*$/ ) { shift @output; } else { warn "Unexpected line in 7zip output, hope that's OK: [$output[0]]"; };" – keeru Jan 06 '18 at 17:54
  • Re "*I checked the changes are already in my system*", The error message you posted in the OP shows otherwise. You have have used the `perldoc` that was installed by a different `perl` then the `perl` used when you obtained the error message. – ikegami Jan 06 '18 at 19:50
  • The warning you are now asking about indicates that `7z` provided different output than expected. – ikegami Jan 06 '18 at 19:52