PDIR and @LABEL questions

May 20, 2008
3,515
4
Elkridge, MD, USA
I ran the command below on both my Win7Pro 64b system (64b TCC 15.01.52) and my WinXP Pro 32b system (same TCC build).

On the WinXP system:
cxs/[s1]/[!descript.ion C:\tmp\*] C:\ G:\ > C:\TMP\20130801.CAT

On the Win7 system:
cxs /[s1] /[!descript.ion C:\tmp\*] C:\ E:\ I:\ > C:\TMP\20130801.CAT

where on both systems:

cxs is an alias : pdir/t:wu/nj/og/s/a:-d/(z r dy-m-d"Z"th:m:s @inode[*] -15@label[*] @serial[*] fpnq)

pdir is an alias : *pdir /ne /d /p

Note that the drives other than C: on each system are locally USB-mounted physical or virtual (solid state) disk drives.

1/ On the Win7 system only, executing pdir /[d] from another TCC instance multiple times, many minutes apart, with nothing else active on the system, showed the same write timestamp and size of the report file. Executing either TAIL or TAIL /F (and immediately interrupting it) on the file and repeating pdir /[d] showed very large size increases. Repeated many times with identical observation. Just using pdir /[d] on the WinXP system always showed a size increase and timestamp change. Is this related to a change between WinXP and Win7 on how files are buffered?

2/ @LABEL reported the correct drive label except when reporting a file on a drive other than on C: if the fpqn field of PDIR actually included quotemarks. In that event it reported the label of the C: drive (of the respective systems). I realize that in a PDIR field the * parameter (@label[*]) is NOT just the drive letter followed by colon, so it is technically an invalid argument. However, the @SERIAL function and the VOL command both accept the same input and report correctly.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
Forgot to mention.
3/ In the %TMP directory both on the WinXP and the Win7 systems during the execution of PDIR files with names like EXEhhh.tmp (where hhh is a 3 or 4 digit hexadecimal number) were created and deleted, never more than one at a time. Which reporting field causes this? Obviously it substantially increases the total execution time, so I would like to eliminate it if possible.
 

rconn

Administrator
Staff member
May 14, 2008
12,363
150
Forgot to mention.
3/ In the %TMP directory both on the WinXP and the Win7 systems during the execution of PDIR files with names like EXEhhh.tmp (where hhh is a 3 or 4 digit hexadecimal number) were created and deleted, never more than one at a time. Which reporting field causes this? Obviously it substantially increases the total execution time, so I would like to eliminate it if possible.


They're not being created by PDIR (or TCC).
 

rconn

Administrator
Staff member
May 14, 2008
12,363
150
1/ On the Win7 system only, executing pdir /[d] from another TCC instance multiple times, many minutes apart, with nothing else active on the system, showed the same write timestamp and size of the report file. Executing either TAIL or TAIL /F (and immediately interrupting it) on the file and repeating pdir /[d] showed very large size increases. Repeated many times with identical observation. Just using pdir /[d] on the WinXP system always showed a size increase and timestamp change. Is this related to a change between WinXP and Win7 on how files are buffered?

That's a Windows filesystem issue. You'll have to ask Microsoft.

2/ @LABEL reported the correct drive label except when reporting a file on a drive other than on C: if the fpqn field of PDIR actually included quotemarks. In that event it reported the label of the C: drive (of the respective systems). I realize that in a PDIR field the * parameter (@label[*]) is NOT just the drive letter followed by colon, so it is technically an invalid argument. However, the @SERIAL function and the VOL command both accept the same input and report correctly.

I don't know that saying "since some functions accept invalid arguments, all functions should accept invalid arguments" makes for a compelling case. In this case, it's the different Windows APIs that are behaving differently. I definitely do *not* think that it's a good idea to secretly alter the user's specified argument to match a perceived "better" argument on a per-API basis.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
Re 1/ - Your response implies "it's a MS change". Now that I know I need to live with it, even though it is yet another backward step by Win7.

Re 2/ - That's not the intended characterization. My point is that some functions return the presumably intended result even if their argument is invalid, some report error, but @LABEL often returns wrong information without ever reporting the user error. I just submitted a FEEDBACK IDEA regarding this issue.

Re 3/ - Since the temporary files were created and removed when only TCC executing PDIR was active, it was a consequence of PDIR. It may have been done by the Windows APIs while processing the functions @LABEL or @INODE, possibly because the functions had invalid arguments. It would benefit users if this could be traced.
 
Similar threads
Thread starter Title Forum Replies Date
Phileosophos PDIR to list filenames without extensions? Support 2
vefatica PDIR and streams Support 1
vefatica PDIR with fixed-width unqualified filename? Support 2
W pdir returns diff results between tcc and tcmd - one is an error msg Support 5
thedave pdir /s Support 2
Emilio III pdir /f switch Support 1
D pdir ignores pm Support 2
WadeHatler pdir broken in 19.1 for directories with spaces Support 1
M WAD PDir not working correctly... Support 5
vefatica WAD Nested variable expansion in PDIR's @function[*]? Support 13
mfarah More on pdir's options: /(fq) Support 5
mfarah How to? Getting pdir to display relative paths. Support 2
M How to? PDir on multiple wildcard patterns... Support 2
A pdir function usage Support 3
T How to? dir/pdir - 2nd level down only Support 7
JohnQSmith PDIR and descriptions Support 21
G WAD PDIR @IF bug, @WORD bug Support 8
S WAD PDIR: files with percent sign % in name cause not listing other files in directory Support 9
S WAD PDIR ignores exclusion ranges Support 1
M PDir format question... Support 3
M How to? "PDir" not working the way the I _thought _ the documentation said it does… Support 8
S WAD /Sn mishandled in DIR and PDIR, possibly elsewhere Support 15
S Fixed GPF in PDIR Support 3
S PDIR issue Support 1
M PDir causing Take Command/TCC to crash... Support 6
M A "PDir" issue... Support 16
M A simple question related to the "dir" (and "pdir") commands... Support 5
J pdir /b1 issue Support 20
M Missing PDir option... Support 5
J Maybe Not So Hard Pdir Question Support 1
S PDIR fails in 12.10.55 Support 3
J V12 PDIR failure Support 1
S PDIR command causes GPF Support 5
D pdir inconsistency Support 4
S PDIR has trouble processing filenames with embedded percent sign Support 3
P PDIR woes Support 0
gschizas pdir crashes horribly in one specific folder Support 5
S PDIR question Support 2
S pdir /(fq) not working Support 5
R Colored directory listing bug with pdir. Support 1
nickles Bias in PDIR Support 5
F pdir problem Support 3
D can PDIR list full filepaths of docs in a nested folder? Support 13
fpefpe How to? gosub and label search Support 4
MikeBaas How to check if label exists? Support 3
A How to? Get Drive Letter From Label Support 3
electrotype Error using TCC: "Label not found" Support 6
R Button label is blank - 11.00.48 Support 0
John Posner Command grouping and GOTO label Support 9
vefatica Questions about aliases. Support 1

Similar threads