dir behaves inconsistently

Jun 24, 2008
223
0
Siegen, Germany
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
 
May 20, 2008
3,515
4
Elkridge, MD, USA
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.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
Sorry, I did not realize the issue reported was the missing "Directory of ..." line when there are no items to report. The OP edited it too much, and added too much color but no description for my tired brain to make the proper interpretation.
 

rconn

Administrator
Staff member
May 14, 2008
12,557
167
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.
 

Similar threads