EasyManua.ls Logo

Atari ST series - Page 125

Atari ST series
420 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
GEMDOS File System Functions
(sometimes an error and list device as well). When a pro
gram spawns a child process with Pexec(), that child inherits
the parent's standard files. The third type of file handle is as
signed to user files on a temporary basis. When a file is cre
ated or opened, a small positive number greater than five is
assigned to it as temporary ID number for the file. The file
handle is used to identify the file for the purposes of any
subsequent GEMDOS file operation. When the program has
no more operations to perform on a particular file, it can
close it, which relinquishes the handle and allows it to be
reassigned. All files are closed automatically when the pro
cess that opened them terminates, or when the media which
contained them is replaced.
Handle
Number Device or File Assignment
- 1 (OxFFFF) CON: (console device)
- 2 (OxFFFE) AUX: (RS-232 serial port)
- 3 (OxFFFD) PRN: (Centronics parallel port)
0 Standard input (usually CON:)
1 Standard output (usually CON:)
2 Standard error
3 Auxiliary
4 Standard list
6 and up User disk files
The first step in writing a file is to create it. The GEM
DOS call used for this function is Fcreate():
char *fname;
int handle, attr;
handle = Fcreate(fname, attr);
where fname is a pointer to a null-terminated ASCII string
containing the name of the file to create. The name can be a
simple file name (such as LETTER.DOC), or a complete path
name (like C:\WORDPROC\LETTERS\BILL.DOC). The attr
value is a flag that specifies the file's attributes. The meaning
of the flag bits is described in Table 6-4.
Table 6-4. Meaning of Flag Bits Used in File Creation
Bit Bit
Number Value Description
0 1 Read-only file (can't be deleted or written to)
1 2 Hidden file (excluded from normal directory
searches)
117

Related product manuals