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
occupies some size.

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.

If that was the case you could use a regular -s instead of that z* trickery, which multiplied by thousands of directories will make a difference.

-- fxn

% touch foo
% ls -l foo
-rw-r--r--   1 fxn  staff  0 Dec 30 20:26 foo
% gzip foo
% ls -l foo.gz
-rw-r--r--   1 fxn  staff  24 Dec 30 20:26 foo.gz
% echo x > bar
% ls -l bar
-rw-r--r--   1 fxn  staff  2 Dec 30 20:27 bar
% gzip bar
% ls -l bar.gz
-rw-r--r--   1 fxn  staff  26 Dec 30 20:27 bar.gz


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to