Boolean DiskCheckInUse( DiskHandle disk);
This routine checks if a registered disk is being used. If a file on that disk is open, or if a path on that disk is on some thread's directory stack, the routine will return true (i.e. non-zero); otherwise it will return false (i.e. zero). Note that a disk may be "in use" even if it is not currently in any drive.
Tips and Tricks: If you pass a standard path constant, this routine will return information about the disk containing the main geos.ini file (which is guaranteed to be in use).
Include: disk.h
Boolean DiskCheckUnnamed( /* returns true if disk is unnamed */ DiskHandle disk);
This routine checks if a registered disk has a permanent name. If the disk does not have a name, the routine returns
true
(i.e. non-zero); otherwise it returns
false
. Note that GEOS assigns a temporary name to unnamed disks when they are registered. To find out a disk's temporary or permanent name, call
DiskGetVolumeName()
.
Tips and Tricks: If you pass a standard path constant, this routine will return information about the disk containing the main geos.ini file.
See Also: DiskGetVolumeName()
.
Include: disk.h
Boolean DiskCheckWritable( DiskHandle disk);
DiskCheckWritable()
checks if a disk is currently writable. It returns
false
(i.e. zero) if the disk is not writable, whether by nature (e.g. a CD-ROM disk) or because the write-protect tab is on; otherwise it returns
true
(i.e. non-zero).
Tips and Tricks: If you pass a standard path constant, this routine will return information about the disk containing the main geos.ini file.
Include: disk.h
DiskCopyError DiskCopy( word source, word dest, Boolean _pascal (*callback) (DiskCopyCallback code, DiskHandle disk, word param));
This routine copies one disk onto another. The destination disk must be formattable to be the same type as the source disk. The first two arguments specify the source and destination drive. These drives may or may not be the same. If they are different, they must take compatible disks.
A disk copy requires frequent interaction with the user. For example, the copy routine must prompt the user to swap disks when necessary. For this reason,
DiskCopy()
is passed a pointer to a callback routine. This routine handles all interaction with the user. It must be declared _pascal. Each time it is called, it is passed three arguments. The first is a member of the
DiskCopyCallback
enumerated type; this argument specifies what the callback routine should do. The second argument is a disk handle; its significance depends on the value of the
DiskCopyCallback
argument. The third argument is a word-sized piece of data whose significance depends on the value of the
DiskCopyCallback
argument. Note that either of these arguments may be null values, depending on the value of the
DiskCopyCallback
argument.
The callback routine can abort the copy by returning
true
(i.e. non-zero); otherwise, it should return
false
(i.e. zero). The callback routine is called for several situations, identified by the value of
DiskCopyCallback
associated with them:
DriveGetName()
to find the name for this drive.
DiskCopy()
will periodically call the callback routine with this parameter. The callback routine may wish to notify the user how the format is progressing. In this case, the second argument will be meaningless; the third parameter will be the percentage of the destination disk which has been formatted. The callback routine may wish to notify the user how the format is progressing.
DiskCopy()
will periodically call the callback routine with this parameter. The callback routine may wish to notify the user how the copy is progressing. In this case, the second parameter will be meaningless; the third parameter will be the percentage of the copy which has been completed.
If the copy was successful,
DiskCopy()
returns zero. Otherwise, it returns a member of the
DiskCopyError
enumerated type. That type has the following members:
Include: disk.h
DiskHandle DiskFind( const char * fname, /* Null-terminated volume name */ DiskFindResult * code); /* DiskFindResult written here */
This routine returns the handle of the disk with the specified name. If there is no registered disk with the specified name,
DiskFind()
returns a null handle. Note that while disk handles are unique, volume names are not; therefore, there may be several registered disks with identical volume names. For this reason,
DiskFind()
writes a member of the
DiskFindResults
enumerated type (described below) into the space pointed to by the
code
pointer.
Structures:
DiskFind()
uses the
DiskFindResult
enumerated type, which has the following values:
Tips and Tricks: If you want to find all the disks with a given volume name, call
DiskForEach()
and have the callback routine check each disk's name with
DiskGetVolumeName()
.
See Also: DiskRegisterDisk()
.
Include: disk.h