in reply to maddening system call gzip/gunzip problems
Your errors fall into two categories.
1. Gunzip won't do anything with files that don't have the correct extension, so running gunzip on the file 'cns061206' (for example) doesn't work. If you want to uncompress something that doesn't have a .gz extension, try zcat cns061206 > newfilename instead.
2. You are attempting to compress files that already have a .gz extension, so gzip won't try and compress it again. Without more details, I would guess that either you didn't unzip these files in the first part of the program, or that some external system has continued to create new .gz files in the directory while you were processing.
Depending on what kind of processing you are doing, you might want to consider taking a better approach than 'unzip everything', 'process everything', 'zip everything'. For example, if you are not actually changing the contents, you can just run 'zcat' on the file and read the output, using something like open( IN, "zcat $file |" ) (or, better yet, something like Compress::Zlib.) If you are modifying the files, you might consider processing them one at a time, rather than a directory at a time, which could avoid problems with new files being created while your program is running.
| We're not surrounded, we're in a target-rich environment! |
|---|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: maddening system call gzip/gunzip problems
by neilwatson (Priest) on Dec 07, 2006 at 17:01 UTC | |
by idsfa (Vicar) on Dec 07, 2006 at 17:31 UTC | |
by neilwatson (Priest) on Dec 07, 2006 at 18:43 UTC | |
by Crackers2 (Parson) on Dec 07, 2006 at 19:32 UTC | |
by neilwatson (Priest) on Dec 07, 2006 at 20:13 UTC | |
by chromatic (Archbishop) on Dec 07, 2006 at 19:21 UTC |