pdir problem

Please note that I give you here a simple example to reproduce it... this is not what I want to do in the end.

For same reason I'm having trouble unquoting file names with pdir:

T:\pdir]dir
6/13/2008 10:58 116 a b.txt
6/13/2008 10:58 184 a.txt

This works as expected, unquoting the file name indicated by the *

[T:\pdir]pdir /A:-d /(@UNQUOTES
[*]) *
T:\pdir\a b.txt
T:\pdir\a.txt


However, these do not work as I expect:

[T:\pdir]pdir /A:-d /(@LEFT[2,%@UNQUOTES
[*]]) *
"T
T:

[T:\pdir]pdir /A:-d /(@RIGHT[-2,%@UNQUOTES
[*]]) *
:\pdir\a b.txt"
\pdir\a.txt



Am I missing something?

TCC 9.02.151 Windows XP [Version 5.1.2600]

Regards,

Franco
 
May 20, 2008
603
0
Sammamish, WA
> [T:\pdir]pdir /A:-d /(@LEFT[2,%@UNQUOTES[*]]) *
> "T
> T:

It's my understanding that you can only have one function -- not
nested as you have done. Define a helper function and it should work.

D:\test>function lu
%@left[%1,%@unquotes[%2]]

D:\test>*pdir /A:-d /(@lu[2,*]) *
D:
D:


D:\test>*dir /k /m /h
2008-06-13 08:10 0 a b.txt
2008-06-13 08:10 0 a.txt

--
2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Saturday.
Measure wealth by the things you have for which you would not take money.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
fstellari wrote:
| Please note that I give you here a simple example to reproduce it...
| this is not what I want to do in the end.
|
| For same reason I'm having trouble unquoting file names with pdir:
|
| T:\pdir]dir
| 6/13/2008 10:58 116 a b.txt
| 6/13/2008 10:58 184 a.txt
|
| This works as expected, unquoting the file name indicated by the *
|
| [T:\pdir]pdir /A:-d /(@UNQUOTES[*]) *
| T:\pdir\a b.txt
| T:\pdir\a.txt
|
| However, these do not work as I expect:
|
| [T:\pdir]pdir /A:-d /(@LEFT[2,%@UNQUOTES[*]]) *
| "T
| T:
|
| [T:\pdir]pdir /A:-d /(@RIGHT[-2,%@UNQUOTES[*]]) *
| :\pdir\a b.txt"
| \pdir\a.txt
|
|
| Am I missing something?
|

Yes. IIRC the % mark must be doubled.
--
HTH, 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
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
D can PDIR list full filepaths of docs in a nested folder? Support 13
fishman@panix.com Problem with 27.15 Support 2
M Problem with VSDevCmd.bat in VS 16.7.3 Support 0
R Problem with @INT[ value] in V26 Support 9
M Selecting test "off by one" problem in Take command Support 4
Alpengreis UTF-8 problem in TCC related to Python Support 7
K_Meinhard Small problem in german IDE 26 Support 3
B Problem with color in nested shells Support 1

Similar threads