HB_DirCreate

HB_DirCreate

Creates a directory

Syntax

      HB_DirCreate( <cNewDir>) --> <nSuccess>

Arguments

<cNewDir> : the name of the directory to be created, including an optional drive. If you do not specify a drive, the current one is used. The new directory can be specified relative to the current directory, or absolute, including a drive letter followed by a colon.

Return

<nSuccess> : zero on success, -1 if there is an argument error; Otherwise, HB_DirCreate() returns the DOS error code. HB_DirCreate() returns 0 if successful;

Description

HB_DirCreate() creates a specified directory. Note that first you must have sufficient rights to create a directory. To create nested subdirectories, you must create each subdirectory separately, starting from the top-level directory that you want to create (see example below.)

Note

HB_DirCreate() is equivalent to HB_DirBuild(), MakeDir() and DirMake()

Examples

      .  This example assumes that C:\TEST exists and uses HB_DirCreate()
         twice to create a nested subdirectory under it:

      HB_DirCreate("c:\test\one")    // Create top-most one
      nResult := HB_DirCreate("c:\test\one\two")
      IF nResult != 0
         ? "Cannot make directory, DOS error ", nResult
         BREAK
      ENDIF

      You may also use something like this:

      HB_DirCreate( ".\test" )

Seealso

DirChange(), DirName(), DirRemove(), MakeDir(), DirChange()

HB_DirBuild

HB_DirBuild

Creates a directory

Syntax

      HB_DirBuild( <cNewDir>) --> <nSuccess>

Arguments

<cNewDir> : the name of the directory to be created, including an optional drive. If you do not specify a drive, the current one is used. The new directory can be specified relative to the current directory, or absolute, including a drive letter followed by a colon.

Return

<nSuccess> : zero on success, -1 if there is an argument error; Otherwise, HB_DirBuild() returns the DOS error code. HB_DirBuild() returns 0 if successful;

Description

HB_DirBuild() creates a specified directory. Note that first you must have sufficient rights to create a directory. To create nested subdirectories, you must create each subdirectory separately, starting from the top-level directory that you want to create (see example below.)

Note

HB_DirBuild() is equivalent to HB_DirCreate(), MakeDir() and DirMake()

Examples

      .  This example assumes that C:\TEST exists and uses HB_DirBuild()
         twice to create a nested subdirectory under it:

      HB_DirBuild("c:\test\one")    // Create top-most one
      nResult := HB_DirBuild("c:\test\one\two")
      IF nResult != 0
         ? "Cannot make directory, DOS error ", nResult
         BREAK
      ENDIF

      You may also use something like this:

      HB_DirBuild( ".\test" )

Seealso

DirChange(), DirName(), DirRemove(), MakeDir(), DirChange(), HB_DirCreate(), DirMake()

HB_CWD

HB_CWD

Change working directory

Syntax

      HB_CWD( [ <cNewWD> ] ) -> <cPrevWD>

Argument

<cNewWD> : New working directory name to set

Return

<cPrevWD> : previous path if new one is set by optional parameter

Description

HB_CWD() can be use as DirName() and/or DirChange() depending on <cNewWD>.

Note

HB_CWD() seem as synonym of DirChange() with some extra features, such as : HB_CWD() function sets FError(). Programmer can check if HB_CWD() succeed checking result of FError() function, i.e.

          HB_CWD( cNewPath )
          IF FError() != 0
             ? "Cannot set working directory to:", cNewPath
          ELSE
             // stuff
          ENDIF

Example

      ? HB_CWD()
      ? HB_CWD( '\TEMP' )

Seealso

DirName(), DirChange()

DirMake

DirMake

Creates a directory

Syntax

      DirMake( <cNewDir>) --> <nSuccess>

Arguments

<cNewDir> : the name of the directory to be created, including an optional drive. If you do not specify a drive, the current one is used. The new directory can be specified relative to the current directory, or absolute, including a drive letter followed by a colon.

Return

<nSuccess> : zero on success, -1 if there is an argument error; Otherwise, DirMake() returns the DOS error code. DirMake() returns 0 if successful;

Description

DirMake() creates a specified directory. Note that first you must have sufficient rights to create a directory. To create nested subdirectories, you must create each subdirectory separately, starting from the top-level directory that you want to create (see example below.)

Note

              DirMake() is equivalent to HB_DirCreate(), MakeDir() and HB_DirBuild()

Examples

      .  This example assumes that C:\TEST exists and uses DirMake()
         twice to create a nested subdirectory under it:

      DirMake("c:\test\one")    // Create top-most one
      nResult := DirMake("c:\test\one\two")
      IF nResult != 0
         ? "Cannot make directory, DOS error ", nResult
         BREAK
      ENDIF

      You may also use something like this:

      DirMake( ".\test" )

Seealso

DirChange(), DirName(), DirRemove(), MakeDir(), DirChange(), HB_DirCreate(), HB_DirBuild()

CT_DIRNAME

 DIRNAME()
 Determines the name of the current directory
------------------------------------------------------------------------------
 Syntax

     DIRNAME([<cDrive>]) --> cDirectory

 Argument

     <cDrive>  Designates the drive for which the current directory is
     determined (a colon is unnecessary).  The default is the current drive.

 Returns

     DIRNAME() returns the current directory name on the <cDrive>.

 Description

     DIRNAME() determines the current directory name on the selected drive.
     You can use this function to construct complete access paths.

 Notes

     .  The maximum length of the returned value is 65 characters.  If
        no drive designator is specified, the current drive is assumed.

     .  If there is an invalid drive designation, DIRNAME() returns a
        null string.

 Examples

     .  Display the current directory name:

        ? "Current Directory:  " + DIRNAME()

     .  With a drive designator:

        ? DIRNAME("A")               // Current directory on Drive A:

See Also: DIRCHANGE() DIRMAKE() DIRREMOVE()

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