in reply to Re: Caturing 7zip output with Perl
in thread Caturing 7zip output with Perl

Sorry for the messy code, the commented out bits are things I've tried and couldn't get working.

Hopefully this is easier to read?

Example of command line

7z.exe a -mx0 -tzip c:\temp\test.zip d:\* -x!$recycle.bin
our $zip_cmd = '"c:\Program Files\7zip\7z.exe"'; our $sysvolume = '"-x!System Volume Information"'; my $exclude_list = ''; $exclude_list = " -x!*RECYCLE.BIN -x!*Thumbs.db -x!*desktop.ini"; my $command = $zip_cmd . ' a -r -mx0 -tzip' . $exclude_list . ' ' . $s +ysvolume . ' ' . $target_zip . ' '; my $ZIP = undef; open($ZIP,"$command |") or die "$package: Could not open pipe for $com +mand, Error: $!\n"; while (my $line = <$ZIP>) { print $line; #Record in the log file $trace and print STDOUT $line; # Report it on the screen if neede +d } close $ZIP;

I'll try your examples