[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Option wanted for gzip
From: |
Raoul Behrend |
Subject: |
Re: Option wanted for gzip |
Date: |
Wed, 30 May 2007 18:55:33 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) |
Hello Bob and the gzip-Team,
Many thanks for the follow up of my proposition.
For the application I devellope, I have to collect gzipped astronomical images,
calibrate (after gunzipping) them, and archive the raw image in a compressed
manner. The new modified ones are also archived after a gzipping, while a copy of
the unzipped processed images are sent to a second pass of reduction.
So, the flux is as below.
raw.fit.gz - archived
- gunzipped - modified by first pass
- gzipped and archived
- second pass of processing
The first and second pass usually are not done at the same moment, as some data
have to be collected and analysed before the second pass. Sometimes, two ot three
passes of the whole files in necessary.
Due to the huge size of the data on the disks, I 'd like to keep to a minimum hard
disk works: this can be done using a kind of keeping of the entry file in its
current state at the end of the decompression or compression operations.
bzip2 had a -k option which do the work nicely. I looked into the gzip source
file, and saw that -k is attributed to a pkzip compression scheme (but apparently
desactivated), so a different option is to be chosen: could it be -K ?
I have difficulties to work with C in a secure way - I basically learned Fortran,
Pascal and Ada. So I'd like some help to manage such an item.
Remark: the naming of the file is unpredictable, so a special unportable macro
should be developped if one want to use the < and > redirectors to specify the
output name, as suggested in your first answer.
Can you help me ?
Kindest regards, Raoul
Bob Proulx a écrit:
Hello Raoul,
Please keep the mailing list address in the CC list so that others may
participate in the discussion.
Raoul Behrend wrote:
Unfortunately, I have to do it on several hundreds of astronomical images
per night, both on linux and on wxp.
I don't understand why that would lead to a special problem in this
case. Are you concerned about some feature in particular? Please
explain so that we may help.
I'm pretty sure that the delete/not delete mechanism at the end of
(de)compression could be managed in ~20 lines and that it would be more
portable than doing special macros to do it.
Now I am twice confused because your original request was for a way to
keep the file and also decompress it avoiding the default gzip/gunzip
behavior of deleting it and here you are asking for a way to delete
the file? As I read things that is the default behavior that you were
asking to avoid! If you want to delete the file then simply let
gzip/gunzip delete the file after decompressing it. Plus I did not
suggest using any "macros". I did not suggest using anything that was
not portable. Therefore I am very confused.
Please explain your concerns. If you could perhaps give an example of
what you are trying to do then I am sure that it would make things
more clear. If using the command as suggested does not work for you
could please say some words about why?
Using the shell to redirect the output of the command is portable. I
think that would be the most portable answer. Because if you were to
add a special option then you would only be able to operate on systems
that had your special version available. If you simply redirect the
output then it will work everywhere.
Bob
Raoul Behrend wrote:
Hello,
Thank you for your fast and kind answer.
Unfortunately, I have to do it on several hundreds of astronomical images
per night, both on linux and on wxp.
I'm pretty sure that the delete/not delete mechanism at the end of
(de)compression could be managed in ~20 lines and that it would be more
portable than doing special macros to do it. I'll look in the gzip source
code how it can be implemented.
Have a plesant sunday. Cheers, Raoul
Bob Proulx a écrit:
Raoul Behrend wrote:
I would really appreciate the presence of a -k option, like in bzip2,
which keeps the original files while making the (de)compression ? Is it
possible ?
Do any of the following do what you want?
gzip -dc file1 > file2
gunzip -c file1 > file2
gzip -d < file1.gz > file2
gunzip < file1.gz > file2
Bob
--
Dr Raoul Behrend
Observatoire de Genève Geneva Observatory
CH-1290 Sauverny CH-1290 Sauverny
Suisse Switzerland
address@hidden
http://obswww.unige.ch/~behrend
Herbe à Nicot? Herbe à nigauds!