bugGNU Octave - Bugs: bug #47359, fileattrib wildcard/globbing...

 
 

bug #47359: fileattrib wildcard/globbing characters handling

Submitted by:  Lutz Mager <rocketsound>
Submitted on:  Mon 07 Mar 2016 05:57:48 PM UTC  
 
Category: Octave FunctionSeverity: 1 - Wish
Priority: 2Item Group: Matlab Compatibility
Status: Need InfoAssigned to: None
Originator Name: rocketsoundOpen/Closed: Open
Release: devOperating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 07 Mar 2016 09:53:03 PM UTC, comment #4:

I'll try to test it at the end of the weekend.

The official docs are quite unspecific about wildcards. I don't know what they mean by saying "To specify all names beginning with certain characters, add the wildcard character, ." However the "internal docs" are more specific and say something like "(...) fileattrib mydir\ recursively displays the attributes of 'mydir' and its contents (...)".

Lutz Mager <rocketsound>
Mon 07 Mar 2016 08:00:36 PM UTC, comment #3:

Documentation on the Windows XP attrib command is here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/attrib.mspx. There is a '/s' option which selects recursive descent and a '/d' option which includes directories in the recursive descent.

It may be that Matlab has not really coded their own fileattrib command, but simply call out to the Windows shell to do the work for them. If so, this would be undocumented Matlab behavior that Octave is unlikely to copy.

At least on a *Nix system the obvious way to solve the original problem would be

On Windows, you could try something like

Rik <rik5>
Project Administrator
Mon 07 Mar 2016 07:21:07 PM UTC, comment #2:

There doesn't seem to be any indication that Matlab itself should even be doing what it appears to do (http://www.mathworks.com/help/matlab/ref/fileattrib.html?#inputarg_name).

Is there any way for you to test with Matlab on a Unix platform to see if this is general behavior, or in fact an oddity only of their own implementation on Windows?

Rik <rik5>
Project Administrator
Mon 07 Mar 2016 05:59:34 PM UTC, comment #1:

I'm sorry, the example directory structure got lost, here's another version:

Lutz Mager <rocketsound>
Mon 07 Mar 2016 05:57:48 PM UTC, original submission:

The core function fileattrib handles the wildcard character * differently then Matlab does, with respect to finding subdirectories and -files. I noticed this while search for an easy way for finding all subdirectories that lie in a given root directory.

Let's say we have to the following directory and file structure:

RootDir
|__Dir1
|__Subdir1
|__MyText.txt
|__Subdir2
|__Dir2

The following script will produce different outputs in Octave or Matlab.

Octave's output:

Matlab's output:

A slightly altered version of the script (notice the second wildcard below) will find the directories one layer below in Octave but will trigger an error in Matlab.

Again, Octave's output:

And the output of Matlab:

You get the point. Octave's fileattrib follows an other logic then Matlab's version does.

Tested this on Windows XP and 7.

Lutz Mager <rocketsound>

 

(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 mtmiller (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by rocketsound (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
    Fri 25 Mar 2016 10:10:56 PM UTCmtmillerRelease4.0.1-rc1=>dev
    Mon 07 Mar 2016 07:32:40 PM UTCrik5Priority5 - Normal=>2
    Mon 07 Mar 2016 07:26:26 PM UTCmtmillerStatusNone=>Need Info
    Mon 07 Mar 2016 07:21:07 PM UTCrik5Severity3 - Normal=>1 - Wish

    Back to the top


    Powered by Savane 3.1-cleanup1