DIR /4 question

May 20, 2008
603
0
Sammamish, WA
Topic "dir.htm" last edited 2009-07-30

"The /4 option is similar to /2, but displays directory information in
4 columns. On drives which do not support long filenames, or when /Z
or /X is used (see below), the display shows the file name and the
file size in kilobytes (KB) or megabytes (MB), with "<D>" in the size
column for directories."


On my Novell drive, which does NOT support long filenames, and on my
Windows FAT and FAT32 drives (which do accept it, so maybe they don't
count), DIR /4 does not show the size. With either /X or /Z added, it
does.

--
Jim Cook
2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Sunday.
 
May 20, 2008
603
0
Sammamish, WA
TCC 11.00.34 Windows XP [Version 5.1.2600]
TCC Build 34 Windows XP Build 2600 Service Pack 3


On Mon, Nov 30, 2009 at 4:12 PM, Jim Cook <> wrote:

> On my Novell drive, which does NOT support long filenames, and on my
> Windows FAT and FAT32 drives (which do accept it, so maybe they don't
> count), DIR /4 does not show the size. With either /X or /Z added, it
> does.

--
Jim Cook
2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Sunday.
 

rconn

Administrator
Staff member
May 14, 2008
12,315
148
> Topic "dir.htm" last edited 2009-07-30
>
> "The /4 option is similar to /2, but displays directory information in
> 4 columns. On drives which do not support long filenames, or when /Z
> or /X is used (see below), the display shows the file name and the
> file size in kilobytes (KB) or megabytes (MB), with "<D>" in the size
> column for directories."
>
>
> On my Novell drive, which does NOT support long filenames, and on my
> Windows FAT and FAT32 drives (which do accept it, so maybe they don't
> count), DIR /4 does not show the size. With either /X or /Z added, it
> does.

WAD. DIR /4 is a (very) obsolete option, which is only there for backwards
compatibility, and only useful when combined with /X or /Z.

The reason it doesn't display sizes on your Novell drive is because your
network redirector is returning "LAN" for the drive type, and it's not
possible for TCC to automagically determine whether it supports LFNs.

Rex Conn
JP Software
 
May 20, 2008
3,515
4
Elkridge, MD, USA
Below I ignore the aspect of the OP that DIR/4 displays only file names, but
not file properties.

rconn wrote:
| WAD. DIR /4 is a (very) obsolete option, which is only there for
| backwards compatibility, and only useful when combined with /X or /Z.

On the contrary, /4 is very useful to just list the (LFN but not
excessively long) names of a large number of files or subdirectories, with
/b /v /w.
In fact, I'd like an enhanced version of the /w option to use only the
currently visible window width, so that horizontal scrolling could be
avoided. To implement it without losing backward compatiblity for those of
us who do not specify each option with its own slash / separator, I suggest
that the new option /ww would require its own option separator. An even
better enhancement to be dreamed about would be dynamic adjustment of column
widths to have only a 2-character gap between columns, based on actual name
lengths, or the use of a column separator character, e.g., the vertical bar
|, preferrably in a different color than the filenames.
The nice feature of building the display routine used for this type of
display is that it could also be used in a few other commands, e.g., ? (to
list all commands).
--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
12,315
148
> rconn wrote:
> | WAD. DIR /4 is a (very) obsolete option, which is only there for
> | backwards compatibility, and only useful when combined with /X or /Z.
>
> On the contrary, /4 is very useful to just list the (LFN but not
> excessively long) names of a large number of files or subdirectories,
> with /b /v /w.

You cannot combine /4 with /w; they will override each other. (And there
wouldn't be any reason to; /w will use as many columns as it can given the
maximum LFN width.)

And /4 (and /w) already imply /b. So the only difference between a "dir /4
/v" and a "dir /w /v" would be that /w would actually work with all LFN name
lengths, and /4 wouldn't.


> In fact, I'd like an enhanced version of the /w option to use only
> the currently visible window width, so that horizontal scrolling
> could be avoided.

I cannot imagine why you would want to create a TCC window that has
horizontal scrolling?!?

Rex Conn
JP Software
 
May 20, 2008
603
0
Sammamish, WA
>>
> ---End Quote---
> I cannot imagine why you would want to create a TCC window that has
> horizontal scrolling?!?
>

In my build process my link lines run to dozens of lines when wrapped.
My boss has his console window thousands of characters wide. Without
that, previous messages and compiled files are well lost off the top.

I had asked something along these lines before in tcmd but will have
to search back to find the thread.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
rconn wrote:
| You cannot combine /4 with /w; they will override each other. (And
| there wouldn't be any reason to; /w will use as many columns as it
| can given the maximum LFN width.)
|
| And /4 (and /w) already imply /b. So the only difference between a
| "dir /4 /v" and a "dir /w /v" would be that /w would actually work
| with all LFN name lengths, and /4 wouldn't.
...
| I cannot imagine why you would want to create a TCC window that has
| horizontal scrolling?!?

You are right, I don't normally create a TCC window that has horizontal
scrolling. However, if a full-width window is created at high screen
resolution, and for the sake of other programs I reduce the resolution, the
TCC window automatically acquires a horizontal scroll bar. If under these
circumstances I want to perform some tasks in the TCC window, and minimize
it again, I want to do it without horziontal scrolling. Most of my activity
fits in the narrower window, and that's what my requested enhancement would
do for DIR/W. Of course, the purpose of the /W (or /B/2 or /4) is to make
better use of the viewing area - a medium-sized directory could be displayed
well on the screen. In my usage the /B/2 or /4 often eliminate horizontal
scrolling, while /W usually makes it necessary.
--
Steve
 
Similar threads
Thread starter Title Forum Replies Date
M A simple question related to the "dir" (and "pdir") commands... Support 5
J DIR /G question Support 2
E Fixed Bug with DIR /Z displaying descriptions Support 8
J Paths shown in DIR /B Support 2
K Fixed Prompt display will be shifted after use dir to display a filename with Chinese. (v25.00.28 x64) Support 18
Jesse Heines How to? How to display picture creation date with dir command Support 6
vefatica WAD DIR.BTM? Support 11
DrusTheAxe DIR reports meaningless SYMLINK information Support 14
C show file description? with dir? Support 8
vefatica DIR /F and streams? Support 7
rps Multi-column DIR /v not displaying all files. Support 5
R How to? Dir specific file search patterns with spaces in the pathnames? Support 6
rps Dir /Nfv -> Alt-F2 Support 2
rps @FILESIZE[....,a] allocated size not matching Dir results Support 8
A TCMD - Dir Command puts out blank lines? Support 16
S Problems with dir command in the debugger Support 5
M TCC incorrect dir output since Windows 1803 Support 6
x13 Problem listing repository files using DIR http(s)://... Support 8
cxxl dir /s works in mysterious ways :( Support 4
vefatica Help nit (FFIND and DIR with /S) Support 0
N Fixed Strange dir behavior Support 6
JohnQSmith Weird DIR output (missing lines) Support 1
C 7zip with date range .vs. filelist created with dir and daterange Support 0
D Towards shared (dir-)history lists Support 3
vefatica WAD DIR /HL still gets names wrong Support 16
vefatica DIR /S /HL? Support 4
H Fixed DIR /G returns wrong sizes Support 2
nickles WAD dir.htm Support 2
vefatica DO dir in /s /a:+d /d"g:\" * ( ... ) Support 26
vefatica DIR \\.\...? Support 4
M Fixed DIR /S /B1 ignores "/S" Support 5
C tcmd.ini not loading from program dir? Support 5
D Fixed Dir /Nm:n has changed Support 1
rps How to? dir /s unexpected results Support 10
vefatica Update to current install dir? Support 8
cgunhouse Problem with "dir /=" Support 4
T dir /h error in empty directory Support 22
P WAD TC 15.0.1.58 x64 crasches with a simple dir command Support 18
CWBillow dir /4 strange Support 2
samintz WAD DIR /B1 and /X Support 2
nickles dir behaves inconsistently Support 5
vefatica DIR, streams, and wildcards? Support 1
vefatica DIR /: /u ... streams not counted? Support 7
vefatica Documentation DIR /B /S /: Support 2
samintz How to? DIR listing for exact match Support 1
dcantor WAD dir "ftp:// ..." fails in TCC 15 Support 7
T How to? dir/pdir - 2nd level down only Support 7
MikeBaas How to? DIR: supress extensions? Support 5
old coot dir /s dies on my C: drive Support 2
A WAD Dir daterange + multiple path wildcards crashes tcc Support 2

Similar threads