bugGNU Octave - Bugs: bug #62414, movefile for relative paths...


bug #62414: movefile for relative paths doesn't work on Windows anymore.

Submitter:  None
Submitted:  Wed 04 May 2022 06:01:31 PM UTC
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Mario Kleiner Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 7.1.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Fri 03 Jun 2022 07:11:20 PM UTC, comment #6: 

Thank you for testing.

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Fri 03 Jun 2022 07:07:29 PM UTC, comment #5: 

Hi again,

i have retested with the snapshot from today 3rd June 2022 and can confirm that the trailing separator problem is now also fixed.

As far as I'm concerned this bug could be close as fixed now.

Have a nice weekend,

Tue 24 May 2022 08:05:34 PM UTC, comment #4: 

Thanks for testing.

I can see where the trailing file separator could be necessary. And since this is a regression from Octave 6, I pushed a fix to the stable branch here:

This should be part of Octave 7.2.

Keeping as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Sat 07 May 2022 02:45:21 PM UTC, comment #3: 

Thanks for the very quick fix! I tested with the Friday release from buildbot.octave.space and can confirm that movefile() on Windows works again for my use cases.

One small difference between _wglob_('..\a\b\c\') on Octave 6.4 and fixed Octave 7.1.1 remains: The final fileseparator is retained under Octave 6.4, but stripped away under 7.1.1, ie.

6.4:   ans = '..\a\b\c\'
7.1.1: ans = '..\a\b\c'

The standard glob('..\a\b\c\') always results in ans = '..\a\b\c\' on both versions, with the final filesep kept in the output.

This didn't affect my scripts, but I thought it is worth pointing out, in case it would matter somewhere else.


Thu 05 May 2022 05:29:27 PM UTC, comment #2: 

I pushed a fix (and some tests) to the stable branch of Octave here:

It should be part of Octave 7.2.0 when it will be released.

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Thu 05 May 2022 09:04:22 AM UTC, comment #1: 

Confirmed here.

The change in `movefile` was made for bug #59287.

Any glob pattern that contains `.` or `..` (representing the local or parent directory) results in an empty output of `__wglob__`.

I'll try and look into it when I come around to it...

Markus Mützel <mmuetzel>
Group administrator
Wed 04 May 2022 06:01:31 PM UTC, original submission:  

Statements like this:

movefile('..\relative\path\to\file', targetpath);

worked since at least October 2015 and Octave 4.

Since Octave 7.1, movefile would report a file not found error.
The culprit seem to be the '..\' part defining the relative path.

This is probably related to the changes in use of _wglob_() instead of glob() inside movefile() and changes to _wglob_() implementation for Windows in Octave 7.

glob('..\relative\path\to\file') still returns correct results,
now returns [] empty instead of the correct path.



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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-03 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2022-05-28 ineiev Carbon-CopyRemoved 0 -
    2022-05-05 mmuetzel StatusConfirmed Ready For Test
    2022-05-05 mmuetzel StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code