Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#173 DirectoryIterator order

Undecided
open
nobody
None
1
2012-10-03
2012-10-03
Ivan Yurchenko
No

Unix implementation of DirectoryIterator (on my Linux) returns files and directories in pretty strange order. This is because readdir() function doesn't guarantee any order. Windows implementation of DirectoryIterator returns files and directories in simple alphabetical order (though it isn't guaranteed too). I can't be sure but VMS implementation may have the same feature.
Class users also may be interested in getting directories before files like most file browsers shows.

Maybe it's reasonable to create some class like SortedDirectoryIterator which will output the content in some kind of convetional way. I've created one and offer a patch which is attached.

1 Attachments

Discussion