Up: GEOS SDK TechDocs | Up | Prev: DiskGetDrive() ... | Next: DriveGetDefaultMedia() ...

DiskSave()

Boolean	DiskSave(
        DiskHandle		disk,
        void *		buffer,				/* data will be written here */
        word *		bufferSize);				/* Size of buffer (in bytes) */

This routine writes information about a disk in the specified buffer. DiskRestore() can use this information to return the disk handle, even in another session of GEOS. The bufferSize argument should point to a word containing the size of the buffer (in bytes). If the buffer is large enough, DiskSave() will write an opaque data structure into the buffer, and change the value of *bufferSize to the actual size of the data structure; any extra buffer space can be freed or otherwise used. In this case, DiskSave() will return true (i.e. non-zero). If the buffer was too small, DiskSave() will return false (i.e. zero) and write the size needed into *bufferSize . Simply call DiskSave() again with a large enough buffer. If DiskSave() failed for some other reason, it will return false and set *bufferSize to zero.

See Also: DiskRestore().

Include: disk.h

DiskSetVolumeName()

word	DiskSetVolumeName(
        DiskHandle		dh,
        const char *		name);			/* Change the name to this */

This routine changes the disk's volume label. If it is successful, it returns zero; otherwise it returns an error code. It also sets or clears the thread's error value appropriately. The following error codes may be returned:

ERROR_INVALID_VOLUME
An invalid disk handle was passed to the routine.
ERROR_ACCESS_DENIED
For some reason, the volume's name could not be changed. For example, the volume might not be writable.
ERROR_DISK_STALE
The drive containing that disk has been deleted. This usually only happens with network drives.

Include: disk.h

DosExec()

word	DosExec(
        const char *		prog,
        DiskHandle 		progDisk,
        const char *		arguments,
        const char *		execDir,
        DiskHandle 		execDisk,
        DosExecFlags 		flags);

This routine shuts down GEOS to run a DOS program. It returns an error code if an error occurs or zero if successful. Its parameters are listed below:

prog
A pointer to a null-terminated character string representing the path of the program to be run. If a null string (not a null pointer), the system's DOS command interpreter will be run. The path string should not contain the drive name.
progDisk
A disk handle indicating the disk on which the program to be executed sits. If zero is passed, the disk on which GEOS resides will be used.
arguments
A pointer to a locked or fixed buffer containing arguments to be passed to the program being run.
execDir
A pointer to a null-terminated character string representing the path in which the program is to be run. The string should not contain the drive name. If a null pointer is passed and execDisk is zero, the program will be run in the directory in which GEOS was first started.
execDisk
The disk handle of the disk containing the directory in execDir .
flags
A record of DosExecFlags indicating whether the DOS program will give a prompt to the user to return to GEOS. The possible flags are DEF_PROMPT, DEF_FORCED_SHUTDOWN, and DEF_INTERACTIVE. For more information, see the entry for DosExecFlags .

If there was no error, DosExec() will return zero. Otherwise it will return one of the following error values: ERROR_FILE_NOT_FOUND, ERROR_DOS_EXEC_IN_PROGRESS, ERROR_INSUFFICIENT_MEMORY, or ERROR_ARGS_TOO_LONG.

Include: system.h


Up: GEOS SDK TechDocs | Up | Prev: DiskGetDrive() ... | Next: DriveGetDefaultMedia() ...