in reply to Compressing files on an entire disk

You can use File::Find::Rule (or any other of the similar tree-recursing modules) to create your list of files and then apply whatever per-file process you desire to each of them. That's how I would approach this task, anyway.

Note that you can extract single files from zip archives should you so wish, so you could still create just one big archive - in case that's an option.


🦛

  • Comment on Re: Compressing files on an entire disk

Replies are listed 'Best First'.
Re^2: Compressing files on an entire disk
by justin423 (Scribe) on Feb 07, 2023 at 20:27 UTC
    ok, I got the search to print a list of files, but I am getting a syntax error when I try to zip them individually.
    my @files = find( file => 'name' => [ ], size => '', in => $directory ); # @output="@files.zip"; my @status = zip @files => @output or die "zip failed: $ZipError\n";
      for my $src (@files) { my $status = zip $src => "${src}.zip" or die "zip failed: $ZipError\n"; } # And, if you're confident unlink @files;

      You cannot just arbitrarily throw arrays into subroutines which explicitly require scalar arguments and expect it to work.


      🦛