Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

dir behaves inconsistently

Jun
223
0
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
 
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.
 
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.
 
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

Back
Top