Dave Roberts wrote:
Andrea Francia wrote:
Niklas Gustavsson wrote:
On Wed, Oct 8, 2008 at 11:44 PM, Andrea Francia <[EMAIL PROTECTED]> wrote:
Why should I do this?
Because it's the order that will be returned to the client, and if
it's a long listing it's better to let the implementation do the
ordering than do it afterwards.
I think that sorting should be a client issue and a client decision.
The client choose to sort by name, modification time, user, group or whatever he wants.

That very much depends on the client, which may not have the capability of performing ordering at all.
If the client needs an ordered file list it should not rely on the server. Not all server do this.

What order do you think the server should return the list? Or are you suggesting that it should be unordered/random according to the backend storage?
My suggestion is to let the implementation choose. And use the same javadoc requirements found in java.io.File#list()

From http://java.sun.com/javase/6/docs/api/java/io/File.html#list()

There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.

A "nicer" implementation could choose to returns the files in alphabetical order, even if I doubt this will be always "nice". The preferred ordering depends by the client and it's purpouse. For example for client which incrementally backup files could prefer the modification time ordering.

--
Andrea Francia
http://andreafrancia.blogspot.com/2008/07/colinux-linux-dentro-windows.html

Reply via email to