bugGNU Octave - Bugs: bug #39357, "dir" function return...

 
 

bug #39357: "dir" function return empty names

Submitter:  None
Submitted:  Fri 28 Jun 2013 01:53:00 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Georg Stillfried Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.4
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 24 Jul 2013 03:11:29 PM UTC, comment #7: 

Good to see it had an answer.  Closing report.

Rik <rik5>
Group administrator
Wed 24 Jul 2013 10:00:31 AM UTC, comment #6: 

Ah, now I found the cause of the problem. It is not a bug in Octave.

I have an own function called index.m which overloads Octave's index.m, but does something different.

After renaming my function it worked fine.

Thanks again for your help!

Anonymous
Wed 24 Jul 2013 09:44:34 AM UTC, comment #5: 

Thank you very much for your answers.

I tried what you suggested and it seems that the problem is in the fileparts function:

octave:2> [a,b,c] = fileparts('/home/user/file.ext')
a = /home/user
b =
c =


Georg

Anonymous
Wed 24 Jul 2013 09:43:16 AM UTC, comment #4: 

Thank you very much for your answers.

I tried what you suggested and it seems that the problem is in the fileparts function:

octave:2> [a,b,c] = fileparts('/home/user/file.ext')
a = /home/user
b =
c =
+verbatim+

Georg

Anonymous
Wed 17 Jul 2013 09:52:33 PM UTC, comment #3: 

Since we can't reproduce it I think you might need to try on your own.  The 'dir' function is an m-file which means it is written in Octave's own scripting language and you can step through the code line-by-line with the debugger until you notice something odd.

Try the following


dbstop dir
a = dir

dbnext


You can just hit <RETURN> to keep executing dbnext and advance line by line.

Rik <rik5>
Group administrator
Tue 02 Jul 2013 01:26:34 PM UTC, comment #2: 

Yes, that is all zeros.

Anonymous
Fri 28 Jun 2013 02:37:25 PM UTC, comment #1: 

Can't reproduce.

Can you please confirm that you really are getting empty strings there instead of some display issue?

What does the following do?


cellfun(@length, {a.name})


Is that all zeros?

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Fri 28 Jun 2013 01:53:00 PM UTC, original submission:  

The "dir" function is supposed to list the files within a directory. It seems to find the files, and to properly store the other attributes like date into a variable. However, the stored or displayed names are empty.

Example:
+verbose+
octave:82> ls
Test1_Ikine_two_ortho_axes.m
octave:83> dir

octave:84> a = dir
a =

  3x1 struct array containing the fields:

    name
    date
    bytes
    isdir
    datenum
    statinfo

octave:85> a.name
ans =
ans =
ans =
octave:86> a.date
ans = 28-Jun-2013 11:55:09
ans = 28-Jun-2013 11:54:54
ans = 28-Jun-2013 12:08:07
-verbose-


Anonymous

 

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

Attach Files:
   
   
Comment:
   

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 rik5 (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-24 rik5 StatusWorks For Me Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2013-06-28 jordigh StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code