HB_CurDrive

HB_CurDrive

Return the current OS drive

Syntax

      HB_CurDrive() --> cDrive
     

Returns

HB_CurDrive() returns the letter of the current DOS drive, without a trailing colon.

Examples

      ? HB_CurDrive()        // D
      ? DiskChange()      // .F.
      ? DiskChange( "C" ) // .T.
      ? HB_CurDrive()        // C
      
      .  This example illustrates the relationship between
         HB_CurDrive()and DISKCHANGE() and shows that HB_CurDrive() is unaffected by
         the SET DEFAULT TO command:
      
      ? HB_CurDrive()      // C
      SET DEFAULT TO A
      ? HB_CurDrive()      // C
      DISKCHANGE("A")
      ? HB_CurDrive()      // A
      DISKCHANGE("C")
      ? HB_CurDrive()      // C
     

Seealso

CurDir(), DiskChange(), DiskName()

DiskName

DiskName

Return the current OS drive

Syntax

      DiskName() --> cDrive

Returns

DiskName() returns the letter of the current DOS drive, without a trailing colon.

Examples

      ? DiskName()        // D
      ? DiskChange()      // .F.
      ? DiskChange( "C" ) // .T.
      ? DiskName()        // C

      .  This example illustrates the relationship between
         DiskName()and DISKCHANGE() and shows that DiskName() is unaffected by
         the SET DEFAULT TO command:

      ? DiskName()      // C
      SET DEFAULT TO A
      ? DiskName()      // C
      DISKCHANGE("A")
      ? DiskName()      // A
      DISKCHANGE("C")
      ? DiskName()      // C

Seealso

CurDir(), DiskChange()

MakeDir

MAKEDIR()

Create a new directory

Syntax

      MAKEDIR( <cDirectory> ) --> nError

Arguments

<cDirectory> The name of the directory you want to create.

Returns

<nError> 0 if directory was successfully created, otherwise the number of the last error.

Description

This function attempt to create a new directory with the name contained in <cDirectory>. If this function fails, it will return the last OS error code number. See FERROR() function for the description of the error

Note

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

Examples

      cDir := "temp"
      IF MakeDir( cDir ) == 0
         ? "Directory", cDir, "successfully created"
      ENDIF

Tests

      See examples

Compliance

This function is CA-Cl*pper 5.3 compliant

Platforms

All

Files

Library is rtl

Seealso

DIRCHANGE(), DIRREMOVE(), ISDISK(), DISKCHANGE(), DISKNAME(), FERROR(), DirMake(), HB_DirCreate(), HB_DirBuild()

IsDisk()

ISDISK()

Verify if a drive is ready

Syntax

      ISDISK( <cDrive> ) --> lSuccess

Arguments

<cDrive> An valid Drive letter

Returns

<lSuccess> .T. is the drive is ready, otherwise .F.

Description

This function attempts to access a drive. If the access to the drive was successfull, it will return true (.T.), otherwise false(.F.). This function is usefull for backup function, so you can determine if the drive that will receive the backup data is ready or not.

Examples

      IF IsDisk( "A" )
         ? "Drive is ready "
      ENDIF

Tests

      See Examples

Compliance

This function is CA-Cl*pper 5.3 compliant

Platforms

All

Files

Library is rtl

Seealso

DIRCHANGE(), MAKEDIR(), DIRREMOVE(), DISKCHANGE(), DISKNAME()

DirRemove()

DIRREMOVE()

Attempt to remove a directory

Syntax

      DIRREMOVE( <cDirectory> ) --> nError

Arguments

<cDirectory> The name of the directory you want to remove.

Returns

<nError> 0 if directory was successfully removed, otherwise the number of the last error.

Description

This function attempt to remove the specified directory in <cDirectory> If this function fails, it will return the last OS error code number. See FERROR() function for the description of the error.

Examples

      cDir := ".\backup"
      IF DirRemove( cDir ) == 0
         ? "Remove of directory", cDir, "was successfull"
      ENDIF

Tests

      See examples

Compliance

This function is CA-Cl*pper 5.3 compliant

Platforms

All

Files

Library is rtl

Seealso

MAKEDIR(), DIRCHANGE(), ISDISK(), DISKCHANGE(), DISKNAME(), FERROR()

DirChange()

DIRCHANGE()

Changes the directory

Syntax

      DIRCHANGE( <cDirectory> ) --> nError

Arguments

<cDirectory> The name of the directory you want do change into.

Returns

<nError> 0 if directory was successfully changed, otherwise the number of the last error.

Description

This function attempt to change the current directory to the one specified in <cDirectory>. If this function fails, it will return the last OS error code number. See FERROR() function for the description of the error.

Examples

      IF DirChange( "\temp" ) == 0
         ? "Change to diretory was successfull"
      ENDIF

Tests

      See examples

Compliance

This function is CA-Cl*pper 5.3 compliant

Platforms

All

Files

Library is rtl

Seealso

MAKEDIR(), DIRREMOVE(), ISDISK(), DISKCHANGE(), DISKNAME(), FERROR()

C5_DISKCHANGE

 DISKCHANGE()
 Change the current DOS disk drive
------------------------------------------------------------------------------
 Syntax

     DISKCHANGE(<cDrive>) --> lSuccess

 Arguments

     <cDrive> specifies the letter of the disk drive to change to.

 Returns

     DISKCHANGE() returns true (.T.) if successful; otherwise, it returns
     false (.F.).

 Examples

     .  This example uses DISKCHANGE() to change to drive "D":

        IF DISKCHANGE("D:")
           ? "Successfully changed"
        ELSE
           ? "Not changed"
        ENDIF

     .  This example builds a string that contains all currently
        available drives on your system:

        FUNCTION AllDrives()
           LOCAL wI, cDrives := ""

           FOR wI := 1 TO 26
              IF DISKCHANGE( Chr(wI + 64) )
                 cDrives := cDrives + Chr(wI + 64)
              ENDIF
           NEXT
        RETURN cDrives

 Files   Library is EXTEND.LIB.

See Also: DIRCHANGE() DISKNAME()



CT_DISKCHANGE

 DISKCHANGE()
 Changes the current disk drive

 Syntax

     DISKCHANGE(<cDrive>) --> lChanged

 Argument

     <cDrive>  Designates which disk drive that you want to use.

 Returns

     DISKCHANGE() returns .T., when the designated disk drive is successfully
     changed.

 Description

     DISKCHANGE() allows you to change from the current disk drive to
     another.  To do this, call DISKCHANGE() with the disk drive identifier
     (A,B,C, etc.).  The drive identifier can be specified with a colon (:).

 Example

     Change to drive C:

     ? DISKCHANGE("C")         // Returns .T. when successful

See Also: DISKNAME() DIRCHANGE()

 

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