Re: checking gzip files



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

.



Relevant Pages

  • Re: Insert with response
    ... FooBar, there's no way and no need to put them in synch. ... column in the foo table to 250 calumns in the bar table. ... set statistics time off ...
    (microsoft.public.sqlserver.programming)
  • Re: Magic function
    ... processing objects created in root at depth 3 ... root obj2 at depth 3 ... processing objects created in foo at depth 2 ... processing objects created in bar at depth 0 ...
    (comp.lang.python)
  • Re: from __future__ import absolute_import ?
    ... foo not in bar ... Unfortunately this is a side effect of using the os's directory structure to represent a python "package" structure. ...
    (comp.lang.python)
  • Re: from __future__ import absolute_import ?
    ... foo not in bar ... A path below the package level is generally a good means to shoot ... to represent a python "package" structure. ...
    (comp.lang.python)
  • Re: how to deserialize variable element/node
    ... string bar; ... In the first deserialization case, bar = "sometimes a simple string is ... Your two XML fragments would have to be represented in an XML schema by ...
    (microsoft.public.dotnet.xml)