bugGNU Octave - Bugs: bug #40274, unpack error on failure to move...


bug #40274: unpack error on failure to move files into destination dir

Submitted by:  Muhali <muhali>
Submitted on:  Tue Oct 15 08:45:10 2013  
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Wed Nov 25 19:35:13 2015, comment #10:

Okay, I added a change here which appears to fix the unpack issue (http://hg.savannah.gnu.org/hgweb/octave/rev/46b15c018fa5). At this point, both tar.gz and gz archives extracted through URLs to /tmp seem to work. The examples I used were

Rik <rik5>
Project Administrator
Wed Nov 25 15:26:32 2015, comment #9:

Unpacking a tar from a URL works for me. Unpacking a compressed file as in the original comment leaves it as a "oct-XXXXXX" file, is that correct?

Mike Miller <mtmiller>
Project Administrator
Tue Nov 24 20:25:29 2015, comment #8:

Actually, could someone else check? Everything seems to work okay now for

Rik <rik5>
Project Administrator
Tue Nov 24 19:55:56 2015, comment #7:

I fixed bug #46504.

Now when I attempt to unpack one of the URL examples from this bug report into '/tmp' I end up with the file in a temporary name. For example, "oct-4mSrub.tar.gz" instead of "bc-1.03.tar.gz.

Rik <rik5>
Project Administrator
Tue Nov 24 19:14:07 2015, comment #6:

see bug #46504. The reason is the call to glob that was added recently (and which does not work for urls).

Muhali <muhali>
Sat Nov 21 15:42:50 2015, comment #5:

Is this bug relevant anymore? I tried the command in question and I now get a "file not found" error from Octave. Apparently http and ftp files are no longer accepted directly into unpack, only real files on a local filesystem.

Rik <rik5>
Project Administrator
Tue Oct 22 01:47:19 2013, comment #4:

Confirmed in two cases. First, your case where you are unpacking from a URL string into /tmp. This is because the URL is first saved to a temporary file in /tmp and then the unpack function fails to recognize that the file is already in /tmp so it doesn't need to be moved.

The other case is when an absolute or relative path are given to a file to unpack and the destination directory is actually the same path.

There is logic in the function already to try to figure out when it needs to move files or not, but that only works if the first argument is a plain file with no path component.

Mike Miller <mtmiller>
Project Administrator
Tue Oct 15 11:37:59 2013, comment #3:

well, savannah does not like my quoted text. Here it is unquoted:

unpack("http://mirrors.ctan.org/support/tex2rtf/rtfutils/rtftohtml/README.gz", "/tmp")

Muhali <muhali>
Tue Oct 15 11:34:55 2013, comment #2:

one more time:

Muhali <muhali>
Tue Oct 15 11:32:33 2013, comment #1:

Sorry, the first command was meant to be

Muhali <muhali>
Tue Oct 15 08:45:10 2013, original submission:

unpacking into /tmp produces the following:

mv: `/tmp/oct-WqCcGr' and `/tmp/oct-WqCcGr' are the same file
error: unpack: unable to move files to "/tmp":
error: called from:
error: /usr/local/share/octave/3.7.7+/m/miscellaneous/unpack.m at line 207, column 9

Corresponding errors occur with unpacking tar files. For example,

just produces a copy of bc-1.03.tar.gz in /tmp. In contrast,

does extract into /tmp/foo.

Muhali <muhali>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by muhali (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Nov 26 05:04:19 2015rik5Open/ClosedOpen=>Closed
    Wed Nov 25 19:35:13 2015rik5StatusReady For Test=>Fixed
    Tue Nov 24 20:25:29 2015rik5StatusConfirmed=>Ready For Test
    Tue Nov 24 19:55:56 2015rik5StatusNeed Info=>Confirmed
    Sat Nov 21 15:42:50 2015rik5StatusConfirmed=>Need Info
    Tue Oct 22 01:47:19 2013mtmillerCategoryNone=>Octave Function
      Item GroupNone=>Incorrect Result
      Summaryunpack into /tmp name clash=>unpack error on failure to move files into destination dir

    Back to the top

    Powered by Savane 3.1-cleanup1