Magic sort order of DOS DIR command

Magic sort order of DOS DIR command

This is output from Mp3tag Cover Export.

Yesterday I got following situation, see sort order of files, incorrect output on option /o-dne.

O:\TEST\COVERS>dir 1*.* /odne

13.03.2008  20:34             5.286 1.jpg
13.03.2008  20:34             7.813 1(1).jpg
13.03.2008  20:34             3.475 1(2).jpg
               3 Datei(en)         16.574 Bytes

O:\TEST\COVERS>dir 1*.* /o-dne

13.03.2008  20:34             7.813 1(1).jpg
13.03.2008  20:34             3.475 1(2).jpg
13.03.2008  20:34             5.286 1.jpg
               3 Datei(en)         16.574 Bytes

Today, with newly created files, I got following situation, see sort order of files, correct output on option /o-dne.

O:\TEST\COVERS>dir 1*.* /odne

14.03.2008  09:16             5.286 1.jpg
14.03.2008  09:16             7.813 1(1).jpg
14.03.2008  09:16             3.475 1(2).jpg
               3 Datei(en)         16.574 Bytes

O:\TEST\COVERS>dir 1*.* /o-dne

14.03.2008  09:16             3.475 1(2).jpg
14.03.2008  09:16             7.813 1(1).jpg
14.03.2008  09:16             5.286 1.jpg
               3 Datei(en)         16.574 Bytes

So what the heck is going on there?

DD.20080314.0924.CET

You could check the entire D (Date/Time). In my german DOS, the help shows the following explanation:

I think your files have some additional (but not visible) information in the time: The seconds.
Maybe this seconds make the difference in sort order?

This is what I did, see option /o-dne, that means sort by date in reverse order.

Could it be that the filesystem registers two files at the identical time point, when they were created in sequence one after another by Mp3tag cover export?

DD.20080315.1717.CET

I checked it again and see what happened:

O:\TEST\COVERS>dir *.* /od

15.03.2008  18:08             3.475 1(2).jpg
15.03.2008  18:08             7.813 1(1).jpg
15.03.2008  18:08             5.286 1.jpg
15.03.2008  18:08                22 identify.in.txt
15.03.2008  18:08             4.110 Mp3tag.magick.identify.cmd
15.03.2008  18:11    <DIR>          ..
15.03.2008  18:11    <DIR>          .

O:\TEST\COVERS>dir 1*.* /od

15.03.2008  18:08             3.475 1(2).jpg
15.03.2008  18:08             5.286 1.jpg
15.03.2008  18:08             7.813 1(1).jpg

Identical sort order /od using different search masks gives different sort results.

Looks like a DOS bug.

DD.20080315.1822.CET