home *** CD-ROM | disk | FTP | other *** search
- {@@@@@@@@@@@@@@@@@ copyright 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@
-
- Standard TURBO procedures for input/output do not support subdirectories.
-
- These file handling procedures are based on the DOS 2.0 "file handle" access
- concept. They are named after their standard TURBO equivalents, but with
- an X in front. Note that these files are not "typed"--they are just files
- of bytes. The "SIZE" parameter determines how many bytes are read at once.
-
- NOTE that any program that INCLUDEs these Extended I/O routines MUST
- also include the type definitions in REGPACK.TYP and FILENAME.TYP,
- and ERRMESSG.LIB, to interpret any error messages.
-
-
- Xreset(VAR FileName : filename_type; VAR handle : integer; VAR error : byte);
- NOTE: for a simple reset of an already-open file, use XSeek.
- Xrewrite(VAR FileName : filename_type; VAR handle : integer; VAR error:byte);
- INPUT : a filename, including full path.
- EFFECT : XRESET opens an already-existing file
- XREWRITE opens a new file, or writes over an existing file
- OUTPUT : an integer FILE HANDLE or a byte ERROR.
-
-
- Xclose(handle : integer ; VAR error : byte);
- INPUT : integer FILE HANDLE
- EFFECT : flushes buffers and closes the file
- OUTPUT : error #6 if handle is wrong
-
- Xread(handle,size : integer ; VAR buffer ; VAR error : byte);
- Xwrite(handle,size : integer ; VAR buffer ; VAR error : byte);
- INPUT : integer FILE HANDLE
- integer SIZE of buffer variable. You can pass this using TURBO's
- builtin SIZEOF(x) function, where x is a variable OR a TYPE.
- EFFECT : reads into or writes from the buffer.
- OUTPUT : byte error message
-
- Xerase(VAR filename : filename_type ; VAR error : byte);
- INPUT : filename, including drive and full path
- EFFECT : erases the named filename
- OUTPUT : byte error message
-
- Xseek(handle, offset,size : integer ; starting_at : char;
- VAR position : integer ; VAR error : byte);
- INPUT : integer FILE HANDLE
- integer OFFSET--how far to seek forward, in # of records
- integer SIZE of each record
- character STARTING_AT: [B]eginning, [E]nd, or [C]urrent position
- EFFECT : moves the file pointer to a position OFFSET*SIZE bytes after
- the position defined by STARTING_AT.
- OUTPUT : integer POSITION--position of file pointer in # of records after
- the move.
- byte ERROR message.
- NOTES : OFFSET and POSITION both have the potential to be 32-bit
- quantities, but since TURBO doesn't handle even true 16-bit
- quantities easily, I didn't implement this possibility. It is
- probably safe to assume that if you want BIG access to BIG files,
- your record size will be such that you won't have more than
- 32,767 records.
- To APPEND to a file, XSEEK Starting_At the [E]nd for an OFFSET
- of 1, SIZE of 1. You'll need a dummy variable for the returned
- POSITION.}
- {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}