Is this a bug in for /o:d ... ?

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Nov 13, 2008
17
0
#1
Hi there,

As you can see below, I want to supply a timewise sorted list of files to a script. As per the documentation "for /o:d" should do it.
But I am not able get it to work so using for /o:d.

22:54:21 C:\...\testfor>*ver

TCC LE 11.00.37 Windows Vista [Version 6.0.6002]

22:56:45 C:\...\testfor>*dir *_* /od

Volume in drive C is OS Serial number is 5eda:3cb7
Directory of C:\holla\bat\renctexp\testfor\*_*

28-08-2010 13:09 1,101,736 3038155_L_S038_A.bmp
28-08-2010 13:18 1,108,992 3038116_L_S033_A.bmp
2,210,728 bytes in 2 files and 0 dirs 2,211,840 bytes allocated
14,859,485,184 bytes free

22:56:51 C:\...\testfor>*for /O:d %a in (*_*) echo %a %@filedate[%a] %@filetime[%a]
3038116_L_S033_A.bmp 28-08-10 13:18
3038155_L_S038_A.bmp 28-08-10 13:09

22:56:54 C:\...\testfor>
It should have echoed file starting with 3038155 first as it was created at 13:09, earlier than 3038116, which is created later at 13:18. :-(

I achieved my goal working around, using for /f %a in ('dir /od /b *_*') though.

I am writing this here because -
1. just in case i am doing something blatently wrong
2. if it is bug and jpsoft might want to know about it.

Thanks for reading...
- Holla
 

rconn

Administrator
Staff member
May 14, 2008
10,101
85
#2
Is this a bug in for /od ... ?

> As you can see below, I want to supply a timewise sorted list of files
> to a script. As per the documentation "*for /o:d*" should do it.
> But I am not able get it to work so using *for /o:d*.
The /O:xx sorting syntax in FOR (or any of the other file handling commands
other than DIR, PDIR, and SELECT) is not supported in TCC/LE.

Rex Conn
JP Software