Re: gzip whole directory with filenames to new directory



On 24 Feb 2006 12:53:37 -0800, "eud9-cpp@xxxxxxxxx" <eud9-cpp@xxxxxxxxx>
wrote:

I would like to gzip all the files in one directory to another
directory while perserving the filenames (i.e. the gzipped file names
are the original filename with ".gz" appended). The key this is two
things: 1) I don't know the filenames in the original directory and 2)
I don't want to copy the files to the new directory and then gzip them.

Does anyone know how to use gzip to accomplish this?

No, gzip isn't designed for that. You'll need a script of some sort to
break the task down into gzip-sized bites.

Offhand, I do believe that DOS batch language can accompish the task, though
it might take a couple of dirty tricks to make it work. If QBasic is
available, all the better, but I think it can be done with just batch.

-Scott
.



Relevant Pages

  • gzip whole directory with filenames to new directory
    ... directory while perserving the filenames (i.e. the gzipped file names ... are the original filename with ".gz" appended). ... 1) I don't know the filenames in the original directory and 2) ... I don't want to copy the files to the new directory and then gzip them. ...
    (comp.compression)
  • GNU/free command line tools
    ... All programs can be configured for either RISC OS or Unix format ... RISC OS or Unix format filenames). ... The programs gzip and bzip2 can preserve filetypes. ...
    (comp.sys.acorn.announce)
  • recoding a directory structure
    ... use spaces & have a borked encoding (the filesystem thinks they are UTF-8 ... I can easily show what one of these filenames should look like using the ... For example xargs transcodes the original filename so ...
    (comp.unix.shell)
  • Reading the name of a file in a .gz
    ... but the filenames are long and truncated sometimes. ... perl, what is the command to read the gzip -l into a variable? ...
    (comp.lang.perl)