Fwd: checking gzip files



Hi all,

I have a 15 thousand directories - each of them contain say 10 files (all
*.gzip)
out of this 10 *.gz files - I want to check whether a file named foo.gz
contain any content or not - since my files are gzipped even the blank file
occupies some size.

have a look at my code
-----------------------------------------
#!/usr/bin/perl
use Shell;

$dir = shift;
$dir ="/home/trial";
opendir(M,"$dir");
@a = readdir(M);
close M;

open(KL,">Dumo-chk");
print KL " << List of foo.gz with no contents >> \n";

foreach (@a)
{
print"\n\t\tProcessing $_\n";
print"\tUncompressing and Readingfoo.gz\n";
next if ($_ =~ /^\./);
# my code works fine untill here ---
------------------------------------ here i have the problem
$dmchk=zless( "$dir/$_/foo.gz");

if (-z "$dmchk")
{
print KL "\n$_ No - content\n";
}
else
{
print KL "$_ -foo-content\n";
}
}


- I am sure there is more than one day to do it
- thanks in advance
Happy PERL
iBioKid - S K


Relevant Pages

  • Re: [Clax86list] Negative numbers
    ... The sign occupies the high order bit position, and thus limits the range. ... Prev by Date: ...
    (comp.lang.asm.x86)
  • Re: Java Man -- CS Question
    ... May co khi ... nao dung winzip and gzip gi` ... Prev by Date: ...
    (soc.culture.vietnamese)
  • Strange file copy result
    ... We have a file that we copy from one folder to the other. ... compressed using gzip and we simply cut and paste the file. ... OS=Windows 2000 with SP4 ... Prev by Date: ...
    (microsoft.public.win2000.file_system)
  • Free disc space on server decreasing quickly
    ... disc of the files changed the last day or so but haven't been able to find ... the files that occupies the space. ... Prev by Date: ...
    (microsoft.public.windows.server.sbs)
  • matlab 7 very slow
    ... I feel it's much much slower than matlab 6, as well as occupies much ... more memories ... Prev by Date: ...
    (comp.soft-sys.matlab)