Atari ST series Technical Reference Manual page 130

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

functions facilitate navigation through a system where there
may be several drives attached, each having several subdirec­
tories. A common example is the function used to set the de­
fault drive. This is the drive that GEMDOS assumes is re­
ferred to when only a filename is used. For example, if you
ask to open a file called MYFILE, rather than using an entire
pathname like C:\FILES\MYFILE, GEMDOS will look for MY­
FILE in the default directory of the default drive. The macro
name for the function used to set the default directory is
Dsetdrv(). This function also returns information about the
number of logical drives recognized by the system. To call
this function, use the following format:
long drives;
int default;
drives = Dsetdrv(default);
where default is the drive number of the drive you wish to
make the current default (drive A: = 0, drive B: = 1, and so
on). A list of known logical drives (those on which a direc­
tory has been used) is returned as a bit flag in drives. Each bit
that corresponds to a known drive is set to 1. For example,
the number 7 has bits 0, 1, and 2 set, which indicates that
drives A:, B:, and C: are connected. Note that logical drives
do not have to be separate physical devices. For example, a
single floppy system will still have two logical drives, since
the floppy can be accessed as either drive A: or drive B:. It's
also possible to partition a single hard drive into several logi­
cal units called C:, D:, E:, and so forth. Finally, portions of
memory may be partitioned into logical RAM drives as well.
On the current version of GEMDOS, up to 16 drives may be
connected, though future versions may support up to 32.
GEMDOS also allows you to find the drive number of
the default drive, with the function Dgetdrv:
int default;
default = D getdrv();
where default is the drive number (0-15) of the current de­
fault drive. This function is useful for building a default path
string to remember where a program should look for data
files, for example.
A related function allows you to set the current default
directory on a drive. As stated above, this is the directory
where GEMDOS will first search for a named file. GEMDOS
CHAPTER 6

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents