commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stian Soiland-Reyes <>
Subject Re: [IO] question: list files ordered natively from the fs?
Date Mon, 06 Jun 2016 13:03:38 GMT
Does the java.nio.newDirectoryStream give you the expected file system order?

You can compare with python os.listdir:

stain@biggiebuntu:~/rc/incubator-taverna-common-activities$ python -c
"import os; print(os.listdir('.'))"
['taverna-spreadsheet-import-activity', '',
'taverna-external-tool-activity', '.git', 'taverna-wsdl-generic',
'taverna-xpath-activity', 'pom.xml', 'taverna-beanshell-activity',
'NOTICE', 'pom.xml.releaseBackup', '',
'taverna-rest-activity', 'DISCLAIMER', 'taverna-interaction-activity',
'.travis.yml', '.gitignore', 'taverna-wsdl-activity', 'LICENSE',

Which at least in Linux should match the order of: ls -Ul

We've talked about updating IO to use Java 7, then
java.nio.newDirectoryStream can be used and provide the native
(possibly weird, but faster) order.

On 6 June 2016 at 11:53, Sergio Fernández <> wrote:
> Hi,
> I've just needed a simple feature, but it should not be that simple if
> there is not helper available in Commons IO...
> I'd like to get the list of files of a directory ordered from the
> filesystem (data, name, etc). I think FileUtils does not provide such
> feature, and all solutions I found are quite naive (order in memory the
> name and order them).
> So, I'd like to ask if there is a good reason for that, probably not enough
> support from the IO/NIO stdlib. But I'd like to know the context before I
> give it a try ;-)
> Cheers,
> --
> Sergio Fernández
> Partner Technology Manager
> Redlink GmbH
> m: +43 6602747925
> e:
> w:

Stian Soiland-Reyes
Apache Taverna (incubating), Apache Commons

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message