CT_DISKREADYW

 DISKREADYW()
 Queries whether you can write to a drive
------------------------------------------------------------------------------
 Syntax

     DISKREADYW([<cDriveId>]), [<lDOS/BIOS>]) --> lDiskReady

 Arguments

     <cDriveId>  Designates which drive designator (A, B, C, etc.) to
     query.  The default value is the current disk drive.

     <lDOS/BIOS>  This logical parameter allows you to specify whether
     you want to query the function through the BIOS (.F.) or DOS (.T.).  The
     default is described in the Description below.

 Returns

     DISKREADYW() returns .T. when you query a drive that is operational and
     can be written to.

 Description

     As with DISKREADY(), this function determines if a drive is ready to
     use.  DISKREADYW() also determines if you can write to a drive.
     DISKREADY() cannot tell if a disk has a write-protect marker on it.  In
     this case, drive A: might be ready, but you could not write to it.  Use
     this function to build write-protect detection for important disks into
     the program.

 Network Drives 

     In general, drives mapped within networks are viewed by the function as
     accessible and return .T. as a result.  For a disk, "accessible" means
     you can create, open, and delete files.  You can clearly differentiate
     these rights within networks such as Novell NETWARE.  Therefore, you
     must test for these accordingly.

 DOS or BIOS 

     In the simplest case, this function always tests the respective drive
     through DOS.  If drive B: is unavailable, the message  "Please insert
     disk in drive B:" is output from the operating system.  When you test
     floppy drives drive A: and B:, the BIOS route is recommended, since no
     message is output.  In any event, A: and/or B: can be mapped drives
     within a network.  Use the following logical expression to cover all the
     previous situations:

     (NETDISK(<cDrive>) .OR. <cDrive> >= "C")

     This logical expression returns .T. when the respective drive is either
     on the network or has a drive identifier of C: or higher.

 Note

     .  Research indicates work in the OS/2 compatibility box must be
        in the BIOS mode.

 Example

     Determine if you can write a file to A: drive:

     IF DISKREADY("A")
        IF NETDISK ("A")
           IF NNETRIGHTS ("A:\")      // complete path
           * ...
           ENDIF
        ELSE
           IF DISKREADYW("A")
           ? "Disk is not write protected!"
           ELSE
           ? "Disk is write protected!"
           ENDIF
        ENDIF
     ELSE
        ? "Disk drive not ready!"
     ENDIF

See Also: DISKREADY()

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