octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #43431] gzip does not handle directories and f


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #43431] gzip does not handle directories and files in different directories
Date: Sun, 19 Jun 2016 01:37:47 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #2, bug #43431 (project octave):

Here's a test that I wrote but I'm not pushing because it's failing and I'm
not sure we can easily work around them using the system's gzip and bzip2.  I
have no idea what behaviour this things should have, but as they are, it's
definetely wrong, and Matlab's behaviour is mad too.


%!test
%! owd = pwd ();
%! outdir = tempname ();
%! testdir = tempname ();
%! unwind_protect
%!
%!   ## We should't need to do this, buy gzip is a bit mad and may create
%!   ## files in the current working directory.
%!   r = mkdir (testdir);
%!   cd (testdir);
%!
%!   r = mkdir (outdir);
%!   if (! r)
%!     error ("failed to create temporary directory for test");
%!   endif
%!
%!   data_file = fullfile (outdir, "test-data");
%!   outfile = [data_file ".gz"];
%!   dummy = pi;
%!   save (data_file, "dummy");
%!
%!   filelist = gzip (data_file);
%!   assert (filelist, {outfile}) # check output
%!   assert (exist (outfile), 2) # confirm file exists # FIXME
%!   assert (exist (data_file), 2) # and did not remove original file
%!
%!   ## FIXME
%!   ## gzip should dutifully re-gzip files even if they already are gz
%!   data_file = fullfile (outdir, "test-data.gz");
%!   outfile = [data_file ".gz"];
%!   dummy = pi;
%!   save (data_file, "dummy");
%!
%!   filelist = gzip (data_file);
%!   assert (filelist, {outfile}) # check output
%!   assert (exist (outfile), 2) # confirm file exists
%!   assert (exist (data_file), 2) # and did not remove original file
%!
%! unwind_protect_cleanup
%!   confirm_recursive_rmdir (false, "local");
%!   rmdir (outdir, "s");
%!   cd (owd);
%!   rmdir (testdir, "s");
%! end_unwind_protect


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43431>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]