[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Changeset] new bzip2 function
From: |
John W. Eaton |
Subject: |
Re: [Changeset] new bzip2 function |
Date: |
Wed, 29 Oct 2008 17:48:37 -0400 |
On 29-Oct-2008, Thorsten Meyer wrote:
| John W. Eaton wrote:
| > On 26-Oct-2008, Thorsten Meyer wrote:
| >
| > | the applied changeset contains a bzip2 function which is analog to the
| > | gzip function.
| > | While fixing the @seealso references to prepare for
| > | @seealso->@ref expansion I found a reference to (the up to now missing)
| > | bzip2 in the docstring of bunzip2.m, so I added this function (instead
| > | of removing the reference to it in the helpfile).
| >
| > Given that this function is almost identical to the gzip function,
| > it seems it would be better to abstract the common parts into a
| > separate function, then write the gzip and bzip2 functions in terms of
| > the common function.
| >
| I agree. I'll try to do it in a way analogous to the unpack function.
Probably you don't need that level of complexity. I'm thinking of
something like
function entries = gzip (files, outdir)
if (nargin == 1 || nargin == 2)
__xzip__ (files, outdir, "gzip", ".gz", "gzip -r %s");
else
print_usage ();
endif
endfunction
and
function entries = bzip2 (files, outdir)
if (nargin == 1 || nargin == 2)
__xzip__ (files, outdir, "bzip2", ".bz2", "bzip2 %s");
else
print_usage ();
endif
endfunction
Given this, converting the current gzip function to __xzip__ should be
fairly easy, I think.
jwe