TrueName

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

TOKEN(), AFTERATNUM()

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s