| Thanks for the answer, but please mind the exact format of what I
| hope to obtain (preferably w/o using any third party tool like perl):
| I'd like to get a listing like this:
| D:\temp\down\ubuntu [DIR]
| D:\temp\down\oki_b6250 60.522
| D:\temp\down\cream.txt 1.199
| D:\temp\down\tux.txt 1.222
| D:\temp\down\yongwei.txt 1.203
| D:\temp\down\ubuntu\$CONFIG [DIR]
| D:\temp\down\ubuntu\$CONFIG\boottime.kmap.gz 4.744
| D:\temp\down\ubuntu\$CONFIG\bookmarks.html 10.565
| D:\temp\down\ubuntu\$CONFIG\prefs.js 4.898
| Btw. Using /u[1|2] in DIR just gives me the one summary line, nothing
| p.s. I alread tried lots of options for DIR and PDIR and neither the
| necessary switches are there (as in the case of the grand total
| summary line), nor the justification is working ok (as in the case of
| PDIR with field length prefixes)...
PDIR does the job for files:
pdir /(-40fpn zc) /s
However, it displays the string "<DIR>" unjusttified, 2 characters left of
where you want it. I had already suggested (for a future version) the
ability of that string to be justified.
Another gotcha: To match CMD.EXE, even in PDIR, which has no matching CMD
command, Rex always displays the widest possible field.
I see two alternatives:
1/ Postprocess ach line, using @REPLACE to move the DIR-indicator, and cut
the size field to your desired width.
2/ Use a function to create the size/DIR field within PDIR, along the lines
- use @IF to determine entry type
- if DIR, return a fixed string of the right width
- if file, use @FILESIZE, combined with @FORMATN, to build the exact format
To generate the single summary line, I would use the DIR/U2, and extract the
one line of interest with @EXECSTR[2,dir/u2/s] (untested!) or with TAIL, and