Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

TRUENAME limitations

May
3,515
5
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
 
> 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:

Same answer as before -- it's a Windows API limitation.

Rex Conn
JP Software
 
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
 
Back
Top