dir listing not starting with . and ..

John W. Eaton jwe at octave.org
Wed Feb 4 14:53:30 CST 2009


On  4-Feb-2009, Jaroslav Hajek wrote:

| My fault, due to an older change string_vector::sort was not working.
| Patch uploaded:
| http://hg.savannah.gnu.org/hgweb/octave/rev/4238f2600a17
| 
| Note that readdir (and, consequently, dir) simply sorts the result.
| This does *not* ensure that . and .. go first.
| If, for instance, a file named "(" exists, it will end up first. Worse
| yet, this is compatible with Matlab 2007a.

This change doesn't seem to work correctly for me.  With it, dir
returns repeated entries and misses other files that exist.  Do you
see the same result?  I noticed it because make check was suddenly
skipping over all the tests in the DLD-FUNCTIONS directory.  After
undoing the change, I don't see the problem, and the list of files
returned by dir still appears to be sorted, with "." and ".." first in
the list.  So I guess I don't understand what the original problem was
that prompted this change.  For now, I've reversed it in the savannah
archive.

jwe


More information about the Bug-octave mailing list