An application is not required to use the System Manager File IO; direct DOS calls may be used instead. If direct DOS IO calls are mixed with System Manager file IO calls, the application should call m_reset_DOS_error before calling the System Manager IO calls. DOS critical errors are handled by the System Manager by setting an error flag within the System Manager. Any of the SysMgr file IO calls check this error and return. If a critical error happens when directly calling DOS, the very next SysMgr file IO call will fail unless m_reset_DOS_error is called.
typedef struct {
int f_handle; /* DOS file handle */
int f_flag; /* see below for flag values */
long pseek; /* physical seek address */
long lseek; /* logical seek address */
long vseek; /* virtual seek address */
int f_len; /* length of valid portion of buffer */
char f_buf[FBUFSIZ]; /* 512 bytes, i/o buffer */
} FILE;
Applications may use either buffered or unbuffered operations. If only unbuffered operations are used, the structure NBFILE can be used in place of FILE to save the RAM that would be used for the file buffer.
typedef struct {
char file_info[sizeof(FILE)-FBUFSIZE];
} NBFILE;
/* this is shorthand to create a structure like FILE, but without the buffer */
Applications that use File I/O services must include the header files FILEIO.H and INTERFAC.H, and may want to include M_ERROR.H for file error codes.