pdir problem

#1
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
 
#2
> [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.
 
#3
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