1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

pdir problem

Discussion in 'Support' started by fstellari, Jun 13, 2008.

  1. fstellari

    Joined:
    Jun 12, 2008
    Messages:
    3
    Likes Received:
    0
    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. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    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. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    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
     
  4. fstellari

    Joined:
    Jun 12, 2008
    Messages:
    3
    Likes Received:
    0
    Thank you both.
     

Share This Page