HB_PathNormalize

HB_PathNormalize

Normalizes the path designation by converting relative path to absolute

Syntax

      HB_PathNormalize( <cRPath> ) -> <cAPath>

Argument

<cRPath> : A path as relative ( include one or more ‘.’ and / or ‘..’ ). It is assumed that it is in accordance with OOS rules.

Returns

<cAPath> : Normalized ( absolute ) path, standardized path whenever possible.

Description

HB_PathNormalize() looks like a synonym of TrueName()

Example

      LOCAL cDir := 'C:\temp\TestSeps'
      ? HB_PathNormalize( cDir + "\.." )  // C:\temp

Seealso

HB_DirSepAdd(), HB_DirSepDel(), HB_DirSepToOS(), TrueName()

HB_DirSepToOS

HB_DirSepToOS

Convert dir separators in a path to OS standard dir separators

Syntax

      HB_DirSepToOS( <cPath1> ) -> <cPath2>

Argument

<cPath1> : A path with any dir separator in it

Returns

<cPath2> : Converted dir separators to OS standard version of <cPath1>

Description

In paths, “dir separator” is a ‘\’ ( back slash ) for DOS / Windows and a “/” ( slash )for U*nix systems

HB_DirSepToOS() is a function to convert dir separators to OS standard

Example

      LOCAL cDir := 'C:/temp/TestSeps'
      ? HB_DirSepToOS( cDir  )            // C:\temp\TestSeps

Seealso

HB_PathNormalize(), HB_DirSepAdd(), HB_DirSepDel(), TrueName()

HB_DirSepDel

HB_DirSepDel

Delete dir separator at end of a path if exists

Syntax

      HB_DirSepDel( <cPath1> ) -> <cPath2>

Argument

<cPath1> : A path either include or not a dir separator at end

Returns

<cPath2> : Absent dir separator at end version of <cPath1>

Description

In paths, “dir separator” is a ‘\’ ( back slash ) for DOS / Windows and a “/” ( slash )for U*nix systems

HB_DirSepAdd() is a function to delete dir separator to end of a path if it’s exist

Example

      LOCAL cDir := 'C:\temp\TestSeps\'
      ? HB_DirSepDel( cDir )  // C:\temp\TestSeps

Seealso

HB_PathNormalize(), HB_DirSepAdd(), HB_DirSepToOS(), TrueName()

HB_DirSepAdd

HB_DirSepAdd

Add a dir separator to end of a path when its missing

Syntax

      HB_DirSepAdd( <cPath1> ) -> <cPath2>

Argument

<cPath1> : A path either include or not a dir separator at end

Returns

<cPath2> : Added dir separator at end version of <cPath1>

Description

In paths, “dir separator” is a ‘\’ ( back slash ) for DOS / Windows and a “/” ( slash )for U*nix systems

HB_DirSepAdd() is a function to add a dir separator to end of a path when its missing

Example

      LOCAL cDir := 'C:\temp\TestSeps'
      ? HB_DirSepAdd( cDir )          // C:\temp\TestSeps\

Seealso

HB_PathNormalize(), HB_DirSepDel(), HB_DirSepToOS(), TrueName()

CT_TRUENAME

 TRUENAME()
 Standardizes the path designation

 Syntax

     TRUENAME(<cPathDesignation>) --> cStandardizedPath

 Argument

     <cPathDesignation>  Designates a path as a standard.  It is assumed
     that it is in accordance with DOS rules.

 Returns

     TRUENAME() 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

     .  Which complete path corresponds to the current disk drive?

        ? TRUENAME(".")                        // e.g. "C:\TEST1"

     .  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

See Also: TOKEN() AFTERATNUM()

 

Tools — Disk Utilities

Introduction Disk Utilities
DELETEFILE() Deletes an error-tolerant file
DIRCHANGE()  Changes the current directory
DIRMAKE()    Creates a directory
DIRNAME()    Determines the name of the current directory
DIRREMOVE()  Removes a directory
DISKCHANGE() Changes the current disk drive
DISKCHECK()  Creates a checksum for a disk
DISKFORMAT() Formats disks, controlled through a UDF
DISKFREE()   Determines the space available on a floppy or hard disk
DISKNAME()   Determines the drive designator for the current drive
DISKREADY()  Tests to see if a disk drive is ready
DISKREADYW() Queries whether you can write to a drive
DISKSPEED()  Determines a comparison value for the drive speed
DISKSTAT()   Determines the status of a drive.
DISKTOTAL()  Determines the total capacity of a floppy or hard disk
DISKTYPE()   Determines the type of data carrier
DRIVETYPE()  Determines the drive type
FILEAPPEND() Appends data to a file
FILEATTR()   Determines a file's attributes
FILECCLOSE() Closes a file after backup mode
FILECCONT()  Copies sections of a file in backup mode
FILECDATI()  Determines which date the target file contains with FILECOPY()
FILECHECK()  Calculates/computes/determines a checksum for a file
FILECOPEN()  Tests to see if the file is still open in the backup mode
FILECOPY()   Copies files normally or in backup mode
FILEDATE()   Determines the file date
FILEDELETE() Deletes file(s) by name and attribute
FILEMOVE()   Moves files to another directory
FILESEEK()   Searches for files by name and attribute
FILESIZE()   Determines the size of a file
FILESTR()    Reads a portion of a file into a string
FILETIME()   Determines a file's time
FILEVALID()  Tests whether a string has a valid file name
FLOPPYTYPE() Determines the exact type of floppy drive
GETSHARE()   Determines the file open (share) mode
NUMDISKF()   Determines the number of installed disk drives
NUMDISKH()   Determines the number of hard disks
NUMDISKL()   Determines the number of available logical drives
RENAMEFILE() Fault tolerant renaming of a file.
RESTFSEEK()  Restores the FILESEEK environment
SAVEFSEEK()  Saves the current FILESEEK environment
SETFATTR()   Sets a file's attributes
SETFCREATE() Default attribute for creating with CA-Clipper Tools functions
SETFDATI()   Sets the date and time of a file
SETSHARE()   Sets default opening mode for CA-Clipper Tools file functions
STRFILE()    Writes a string to a file
TEMPFILE()   Creates a file for temporary use
TRUENAME()   Standardizes the path designation
VOLSERIAL()  Determines the DOS disk serial number
VOLUME()     Establishes a volume label for a floppy or hard disk