Fwd: checking gzip files

2005-12-30 Thread S Khadar
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

Re: checking gzip files

2005-12-30 Thread Tom Phoenix
On 12/30/05, S Khadar [EMAIL PROTECTED] wrote: $dir = shift; $dir =/home/trial; You seem to be over-writing what you just put into $dir. (I think this is just your debugging code, though.) opendir(M,$dir); Just as when using open(), it's important to check for errors with opendir() by using

Re: checking gzip files

2005-12-30 Thread Adriano Ferreira
On 12/30/05, S Khadar [EMAIL PROTECTED] wrote: #!/usr/bin/perl use Shell; ... $dmchk=zless( $dir/$_/foo.gz); As an aside note, Cperldoc Shell advises against this style [ use Shell nothing ; ]. Prefer this: use Shell qw(zless); so that you know that you are not calling some

Re: checking gzip files

2005-12-30 Thread Xavier Noria
On Dec 30, 2005, at 13:14, S Khadar wrote: 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

Re: checking gzip files

2005-12-30 Thread Adriano Ferreira
On 12/30/05, Xavier Noria [EMAIL PROTECTED] wrote: Even if gzipped files have always more than 0 bytes, wouldn't it be true than all empty gzipped files have the same size, and that non- empty gzipped files are greater than that minimum? In this Mac that size seems to be 24 bytes. Nope.