Fwd: checking gzip files
- From: ibiokid@xxxxxxxxx (S Khadar)
- Date: Fri, 30 Dec 2005 17:44:46 +0530
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
- Follow-Ups:
- Re: checking gzip files
- From: Xavier Noria
- Re: checking gzip files
- From: Adriano Ferreira
- Re: checking gzip files
- From: Tom Phoenix
- Re: checking gzip files
- Prev by Date: Re: Plotting a 2D chart
- Next by Date: Working with very large text files
- Previous by thread: Plotting a 2D chart
- Next by thread: Re: checking gzip files
- Index(es):
Relevant Pages
|