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