> On 12/29/2021 1:58 AM, Paul Edwards wrote:
> > Here is the result of one "dir /od" that I did with
> > Freedos 1.5 RC5. As you can see, it didn't get
> > into sorted order.
> >
> > BFN. Paul.


On Wed, Dec 29, 2021 at 11:43 AM Ralf Quint <[email protected]> wrote:
> I just tried this and can NOT confirm this (Virtual Box of 1.5RC5)...
>
> It just sorts all folders and files in the proper tagged time/date stamp
> order...

As a reminder, the "/O:D" option orders by date and time (earliest first)

/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
             U  Unsorted                   Defaults to /ONG


But don't forget that FreeDOS 1.3 RC5 also sets a DIRCMD environment
variable, so you need to consider that too:

C:\>echo %DIRCMD%
/P /O:GN /Y


The "G" means to group directories, and "N" means to sort by filename.

If you do "DIR /O:D" (or "DIR /OD" - the ":" is assumed here) with the
DIRCMD environment variable set, your DIR command line options are in
addition to DIRCMD. For example, my system gives a DIR like this:


D:\SRC\PVPGEM1>echo %DIRCMD%
/P /OGN /Y
D:\SRC\PVPGEM1>dir
 Volume in drive D is FILES
 Volume Serial Number is 183D-1C1A

 Directory of D:\SRC\PVPGEM1

.                    <DIR>  12-27-2021 10:03p
..                   <DIR>  12-27-2021 10:03p
KEYS     C             346  12-27-2021 11:25p
KEYS     EXE         8,962  12-27-2021 11:25p
KEYS     OBJ           503  12-27-2021 11:25p
PVPGEM   C           9,050  12-29-2021 12:38a
PVPGEM   EXE        48,214  12-29-2021 12:38a
PVPGEM   OBJ         3,219  12-29-2021 12:38a
         6 file(s)         70,294 bytes
         2 dir(s)     488,308,736 bytes free


Adding "/O:D" on top of that will slightly adjust the order:


D:\SRC\PVPGEM1>echo %DIRCMD%
/P /OGN /Y
D:\SRC\PVPGEM1>dir /O:D
 Volume in drive D is FILES
 Volume Serial Number is 183D-1C1A

 Directory of D:\SRC\PVPGEM1

.                    <DIR>  12-27-2021 10:03p
..                   <DIR>  12-27-2021 10:03p
KEYS     C             346  12-27-2021 11:25p
KEYS     OBJ           503  12-27-2021 11:25p
KEYS     EXE         8,962  12-27-2021 11:25p
PVPGEM   C           9,050  12-29-2021 12:38a
PVPGEM   OBJ         3,219  12-29-2021 12:38a
PVPGEM   EXE        48,214  12-29-2021 12:38a
         6 file(s)         70,294 bytes
         2 dir(s)     488,308,736 bytes free


But if I unset the DIRCMD environment variable, I'll get a different ordering:


D:\SRC\PVPGEM1>set DIRCMD=
D:\SRC\PVPGEM1>dir
 Volume in drive D is FILES
 Volume Serial Number is 183D-1C1A

 Directory of D:\SRC\PVPGEM1

.                    <DIR>  12-27-21 10:03p
..                   <DIR>  12-27-21 10:03p
PVPGEM   C           9,050  12-29-21 12:38a
PVPGEM   OBJ         3,219  12-29-21 12:38a
PVPGEM   EXE        48,214  12-29-21 12:38a
KEYS     C             346  12-27-21 11:25p
KEYS     OBJ           503  12-27-21 11:25p
KEYS     EXE         8,962  12-27-21 11:25p
         6 file(s)         70,294 bytes
         2 dir(s)     488,308,736 bytes free


And using /O:D to order by date and time:


D:\SRC\PVPGEM1>set DIRCMD=
D:\SRC\PVPGEM1>dir /O:D
 Volume in drive D is FILES
 Volume Serial Number is 183D-1C1A

 Directory of D:\SRC\PVPGEM1

.                    <DIR>  12-27-21 10:03p
..                   <DIR>  12-27-21 10:03p
KEYS     C             346  12-27-21 11:25p
KEYS     OBJ           503  12-27-21 11:25p
KEYS     EXE         8,962  12-27-21 11:25p
PVPGEM   C           9,050  12-29-21 12:38a
PVPGEM   OBJ         3,219  12-29-21 12:38a
PVPGEM   EXE        48,214  12-29-21 12:38a
         6 file(s)         70,294 bytes
         2 dir(s)     488,308,736 bytes free



I hope that helps.

Jim


_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to