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

TRUENAME limitations

Discussion in 'Support' started by Steve Fabian, Dec 25, 2008.

  1. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    IIRC this issue may have come up in the past. Regardless, on my WinXP SP3
    NTFS system TRUENAME does not resolve directory junctions if the parameter
    is a file in the junction. It works correctly for the junction (directory)
    itself, even through 2 levels of junctions:

    real directory tree (partial)

    C:\JPSOFT
    +--INIKEY
    | \--I09
    \--PL09

    junctions:

    C:\JPSOFT\K09\ -> C:\JPSOFT\INIKEY\I09\
    C:\JPSOFT\INIKEY\I09\PLUGINS\ -> C:\JPSOFT\PL09

    TRUENAME command report

    command parameter command output
    C:\JPSOFT\K09\ C:\JPSOFT\INIKEY\I09
    C:\JPSOFT\K09\PLUGINS\ C:\JPSOFT\PL09
    C:\JPSOFT\K09\PLUGINS\FedUtils8.dll C:\JPSOFT\K09\PLUGINS\FedUtils8.dll

    The first two, which are directories, are resolved correctly. The last one,
    a file, is not resolved at all. The results are identical in 4nt 7.01.370,
    4nt 8.02.106, TCC 9.02.154, and the latest test build.
    --
    Steve
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,991
    Likes Received:
    84
    Same answer as before -- it's a Windows API limitation.

    Rex Conn
    JP Software
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    rconn wrote:
    || ---Quote---
    ||| IIRC this issue may have come up in the past. Regardless, on my
    ||| WinXP SP3 NTFS system TRUENAME does not resolve directory junctions
    ||| if the parameter is a file in the junction. It works correctly for
    ||| the junction (directory) itself, even through 2 levels of junctions:
    || ---End Quote---
    || Same answer as before -- it's a Windows API limitation.

    Undoubtedly you could work around this particular limitation. The batch
    program below overcomes it:

    @echo off
    setlocal
    set z=%@attrib[%1,D]
    switch %z
    case 0
    set x=%@path[%@lfn[%1]]
    case 1
    set x=%@lfn[%1]
    endswitch
    set t1=%@truename[%x]
    set t2=%@truename[%t1]
    do while "%t1" NE "%t2"
    set t1=%t2
    set t2=%@truename[%t1]
    enddo
    switch %z
    case 0
    echo %t1\%@filename[%1]
    case 1
    echo %t1
    endswitch

    I also defined

    function tn=`%@execstr[tn %1]`

    Why not encode the same logic into TCC?
    --
    Steve
     

Share This Page