[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #56700] unzip with one argument does not unzip
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #56700] unzip with one argument does not unzip to the current working directory |
Date: |
Wed, 31 Jul 2019 15:15:42 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko |
Follow-up Comment #2, bug #56700 (project octave):
I can confirm Mike's comment #1 that the unpacking of the zip file is done in
the remote director, rather than the current directory, if none is specified.
The help text is explicit about this
If DIR is specified the files are unpacked in this directory rather
than the one where ZIPFILE is located.
On the other hand, Matlab's documentation
(https://www.mathworks.com/help/matlab/ref/unzip.html) is also explicit about
what it does
unzip(zipfilename) extracts the archived contents of zipfilename into the
current folder
The code in question was introduced in to unzip.m by me in 2014 in cset
a4e993343e93.
19258: function filelist = unzip (zipfile, dir = [])
5808:
19258: if (nargin < 1 || nargin > 2)
6081: print_usage ();
5808: endif
5808:
19258: if (isempty (dir))
19258: dir = fileparts (zipfile);
19258: endif
It's simple enough to change this to
if (isempty (dir))
dir = pwd ();
endif
which I verified does what Matlab does.
I don't care much either way, but if we want to go for Matlab compatibility
then it would be helpful if someone could review all of the pack/unpack files
for campatibility. For example, gunzip and untar are also Matlab functions
which do roughly the same thing.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?56700>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/