pdir inconsistency

Sep 2, 2008
8
0
Scotland
One of two of my old script are getting output truncated using TCC 11.00.33 x64. Happening where I'm using '()' brackets in the output. Works ok if I use '{}' brackets instead.

Is this limitation by design?

Here's an example ("ss" is a variable in my original script):

[C:\Users\Public\Music\Sample Music]pdir /(dy-m-d th:m f ("ss"))
2009-07-14 05:32 Kalimba.mp3 (ss
2009-07-14 05:32 Maid with the Flaxen Hair.mp3 (ss
2009-07-14 05:32 Sleep Away.mp3 (ss

[C:\Users\Public\Music\Sample Music]m:\Apps\4NT\4nt.exe /c pdir /(dy-m-d th:m f ("ss"))
2009-07-14 05:32 Kalimba.mp3 (ss)
2009-07-14 05:32 Maid with the Flaxen Hair.mp3 (ss)
2009-07-14 05:32 Sleep Away.mp3 (ss)

[C:\Users\Public\Music\Sample Music]pdir /(dy-m-d th:m f {"ss"})
2009-07-14 05:32 Kalimba.mp3 {ss}
2009-07-14 05:32 Maid with the Flaxen Hair.mp3 {ss}
2009-07-14 05:32 Sleep Away.mp3 {ss}
 
May 20, 2008
3,515
4
Elkridge, MD, USA
djgibson wrote:
| One of two of my old script are getting output truncated using TCC
| 11.00.33 x64. Happening where I'm using '()' brackets in the output.
| Works ok if I use '{}' brackets instead.
|
| Is this limitation by design?
|
| Here's an example ("ss" is a variable in my original script):
|
| [C:\Users\Public\Music\Sample Music]pdir /(dy-m-d th:m f ("ss"))
| 2009-07-14 05:32 Kalimba.mp3 (ss
| 2009-07-14 05:32 Maid with the Flaxen Hair.mp3 (ss
| 2009-07-14 05:32 Sleep Away.mp3 (ss
...

Confirmed in 32-b build (TCC 11.00.33 Windows XP [Version 5.1.2600]).
Even with the corrected syntax

pdir /a: /(dy-m-d th:m f "(ss)")

the right parenthesis of the quoted string disappears.
--
Steve
 
May 20, 2008
3,515
4
Elkridge, MD, USA
djgibson wrote:
| One of two of my old script are getting output truncated using TCC
| 11.00.33 x64. Happening where I'm using '()' brackets in the output.
| Works ok if I use '{}' brackets instead.

The problem is the same in 10.0.76 - the trailing right parenthesis is
dropped. The same syntax works as expected in 4nt 8.02.106 and tcc 9.02.156.
--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
12,315
148
> One of two of my old script are getting output truncated using TCC
> 11.00.33 x64. Happening where I'm using '()' brackets in the output.
> Works ok if I use '{}' brackets instead.
>
> Is this limitation by design?

Yes. (Also your syntax is wrong; you cannot use either ( or ) outside of a
quoted string unless you want them processed as delimiters.)

Because I couldn't think of any good reason to use () *inside* a quoted
string in PDIR (and to simplify parsing several other new features), PDIR is
going to truncate the argument at the first ), regardless of whether it's
inside a string.

Rex Conn
JP Software
 
May 20, 2008
3,515
4
Elkridge, MD, USA
rconn wrote:
| Because I couldn't think of any good reason to use () *inside* a
| quoted string in PDIR (and to simplify parsing several other new
| features), PDIR is going to truncate the argument at the first ),
| regardless of whether it's inside a string.

Not asking for a code change, though a documentation change would avoid
future questions. However, I can suggest at least one reason to use
parentheses inside a quoted string in PDIR's output: to create a batch file
which executes a command group. If I understood the OP correctly, in the
original form (not the one reduced for the purpose of discrepancy reporting)
the quoted string in parentheses contained at least one variable or variable
function, thus being a dynamic field in the report.
--
Steve
 
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
S PDIR and @LABEL questions Support 4
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
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
R Inconsistency in @version's use of quotes Support 2
jbanaszczyk help files: minor inconsistency Support 2
thedave BDEBUGGER vs not inconsistency Support 15
M If and Iff inconsistency... Support 9
Jay Sage Inconsistency in Date Formats Between @DATE and @MAKEDATE Support 3

Similar threads