bugGNU Octave - Bugs: bug #49628, copyfile fails to copy source...

 
 

bug #49628: copyfile fails to copy source files with [ or ] characters in the name

Submitted by:  Richard Suchland <suchland>
Submitted on:  Wed 16 Nov 2016 09:42:10 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: ConfirmedAssigned to: None
Originator Name: Open/Closed: Open
Release: 4.2.0Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 17 Nov 2016 04:48:52 AM UTC, comment #4:

Oh, sure enough, I forgot that this was only fixed for the dir functions, and not for every function that calls glob, which I now remember the explicit reasons for. So yeah maybe we should do this for every function that can operate on wildcard patterns, where the user is expecting to be able to use Windows wildcards and not the extended POSIX glob wildcard characters.

Mike Miller <mtmiller>
Project Administrator
Thu 17 Nov 2016 04:00:39 AM UTC, comment #3:

This was solved for dir.m by introducing a new C++ function _wglob_ which performs a Windows-like glob. The same issue came up ot bug #47950, to wit, should we have glob be system-dependent or not? If not, then you can solve this by having code in each and every m-file that checks for ispc() and ! isunix() and then calls _wglob_ or glob appropriately.

Affected functions are:

copyfile
delete
fileattrib
movefile
unpack
pkg/private/install.m
pkg/private/rebuild.m

Rik <rik5>
Project Administrator
Thu 17 Nov 2016 02:40:29 AM UTC, comment #2:

Tried Octave 4.2 for Windows 64bit and got the same result:

>> mkdir('c:/','test');
>> fid = fopen('c:/test/test[1].txt','w')

fid = 3

>> fputs(fid,"This is a test");
>> fclose(fid);
>> [status, msg, msgid] = copyfile('c:/test/test[1].txt','c:/test/test[2].txt');

error: copyfile: no files to move
error: called from
copyfile at line 85 column 5

No Joy!

Richard Suchland <suchland>
Wed 16 Nov 2016 09:45:27 PM UTC, comment #1:

If this is indeed related to bug #47950, then it should be fixed in Octave 4.2. Can you download and try it with 4.2? Or someone else with access to Windows confirm that 4.2 fixes this example?

Mike Miller <mtmiller>
Project Administrator
Wed 16 Nov 2016 09:42:10 PM UTC, original submission:

Tried to copy a file with [ and ] characters in the filename and it failed. I suspect this may be related to Octave bug ##47950.
Here is a sample:
Works with the proposed workaround for bug #47950 but not without

Richard Suchland <suchland>

 

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

Attach File(s):
   
   
Comment:
   

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 suchland (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 17 Nov 2016 04:00:39 AM UTCrik5Item GroupIncorrect Result=>Matlab Compatibility
      StatusNeed Info=>Confirmed
      Release4.0.0=>4.2.0
    Wed 16 Nov 2016 09:45:27 PM UTCmtmillerStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1