dir behaves inconsistently

#1
Depending on whether files are found in a directory, the following command behaves inconsistently:

x> dir /a /ogen /h /ne /nf /nv /t /x /:
0 bytes in 0 files and 0 dirs

: Create some file
x> > x

x> dir /a /ogen /h /ne /nf /nv /t /x /:
Directory of ...\x\* : This output is missing above!
30.07.2013 10:48 0 ___A___________ x
0 bytes in 1 file and 0 dirs
 
#2
Your examples do not display the full path of the root directory of the DIR commands. Even assuming that DIR is not an alias, it is difficult to figure out what the total directory content is for each command, so we could reliably comment. Please list content first. Please also try the commands without the /: (show streams) option to see if it causes the reported confusion.
 

rconn

Administrator
Staff member
May 14, 2008
10,551
97
#5
Depending on whether files are found in a directory, the following command behaves inconsistently:

x> dir /a /ogen /h /ne /nf /nv /t /x /:
0 bytes in 0 files and 0 dirs
TCC, 4NT, 4DOS, CMD, and COMMAND.COM behave the same way. Do you really want to see a directory header (potentially tens of thousands of directory headers if you use /S) when there aren't any files?

If you want this as an option, you can request it in the Feedback forum. It will definitely not be the default behavior for DIR.