TrueName
Standardizes the path designation by converting relative path to absolute
Syntax
TrueName( <cPathDesignation> ) --> <cStandardizedPath>
Argument
<cPathDesignation> : Designates a path as a standard. It is assumed that it is in accordance with DOS rules.
Returns
<cStandardizedPath> : returns the standardized path whenever possible.
Description
Path designations are made for the drive as well as the path itself, with regard to the current position designation. With TrueName(), related path designations are changed around so that they relate to the root directory of a particular drive.
The function does not test to see if a path exists. If the designated path is not valid or the specified drive is unavailable, it returns a null string.
Note
Warning! Additional information is built into the path of network drives. Under PC-LAN/MS-NET, the path contains the designation:\\<ServerName>. Under Novell, \\<ServerName>\ <VolumeName> (see Examples).
Examples
? CurDir() // temp ? TrueName(".") // C:\temp DirChange( "\temp" ) ? TrueName( "." ) // C:\temp DirChange( "dir1" ) ? CurDir() // temp\dir1 ? TrueName( "." ) // C:\temp\dir1 ? TrueName( ".." ) // C:\temp . Anything valid under DOS is acceptable: ? TrueName("..\..\TEST1\.\TEST2") // e.g. "C:\TEST1\TEST2" . In a Novell network, remove tokens 2 and 3, server name, and volume name: IF NNETWORK() cPath := TrueName(cOldPath) cToken1 := TOKEN(cPath, ":\", 1) cToken2 := TOKEN(cPath, ":\", 2) cToken3 := TOKEN(cPath, ":\", 3) cPath := cToken1 + AFTERATNUM(cToken2 + cToken3, cPath) ENDIF
Files
Lib is hbct
Seealso