This post is more than 5 years old

3 Posts

962

July 20th, 2007 10:00

file sort order?

Hi all. We have an EMC Celerra NS702g running Dart 5.5. The file system is formatted UFS. When we mount our NAS share as a network drive on a windows machine, the 'dir' command on this drive always returns the files in DATE order instead of NAME order.

As I understand, the 'dir' command without any switches uses the native sort of the underlying file system. Unfortunately, we have a piece of vendor software that is expecting the 'dir' command to always return files in alphabetical order. My storage folks tell me that this is a Windows settings or preferences problem, but we see the same behavior on any client. Inside Explorer the sorting is fine, but I would expect this since Explorer clearly sorts the files on its own.

1. Am I correct in understanding that this is an issue w/ the storage and not with the client?

2. If so, how can we change the sorting behavior on the NAS?

117 Posts

July 24th, 2007 22:00

Hi jaf,

When we return directory results, they're returned in the order that they're stored in our directory(ies) (which is going to tend to be in the order they were created). No sorting is done before the results are returned - that's typically left up to the application (to sort in whichever way is appropriate).

-Ian

July 23rd, 2007 05:00

Well the issue really seems to be with the software rather than anything else, but is the software actually using the 'dir' command? If so, you could set the DIRCMD environment variable (in autoexec.bat) to the particular switches you want 'dir' to use by default.

Here's some of the DIR switches, including sorting switches

/P Pauses after each screen full of information.
/W Uses wide list format.
/A Displays files with specified attributes.
attributes D Directories R Read-only files
H Hidden files A Files ready for archiving
S System files - Prefix meaning not
/O List by files in sorted order.
sortorder N By name (alphabetic) S By size (smallest first)
E By extension (alphabetic) D By date & time (earliest first)
G Group directories first - Prefix to reverse order
A By Last Access Date (earliest first)
/S Displays files in specified directory and all subdirectories.
/B Uses bare format (no heading information or summary).
/L Uses lowercase.
/V Verbose mode.
/4 Displays year with 4 digits (ignored if /V also given).

3 Posts

July 24th, 2007 05:00

Believe me, I understand the dir switches. According to MS's documentation, "If you omit /o, dir displays the names in the order in which they occur in the directory." I take that as meaning however the device chooses to return the files.

Now no, we are not actually using the 'dir' as a shell command in the software. Its a java application using the File.listFiles method. According to the javadocs: "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."

Ok, so we know that our vendor's app should be doing the sorting... that's all well and good. However, if we point the application to a windows share that is attached EMC SAN, both the application and a dir command return the files in the correct alphabetical order (even though no sorting is specified).

But, if we put our files on the EMC NAS, both the dir command and the java application return the files by date order. The only difference is the NAS. Therefore, my conclusion is that there is some setting that causes the NAS to return files by default in date order? Does this make any sense?

0 events found

No Events found!

Top