DataLoader/MX Reference Manual (H06.03+, J06.03+)

Creating a Customized Version of DataLoader/MX
DataLoader/MX Reference Manual543544-001
5-20
Sequential I/O
DTLOpen
This procedure opens the file whose name, together with any requested features, is
pointed to by Name.
The syntax is:
Name must be null-terminated and must contain either an OSS file name or a Guardian
file name. If Name starts with one of these characters, DataLoader/MX handles it as a
Guardian file:
$
\
=
/G
/E
Otherwise, it is handled as an OSS file.
The file is opened for either read or write access, depending upon AccessMode. If the
string pointed to by AccessMode is an uppercase or lowercase letter r, the file is
opened for read access. If the string pointed to by AccessMode is an uppercase or
lowercase letter w, the file is opened for write access. This string must be
null-terminated.
The value returned by this procedure is a positive integer, referred to DataLoader/MX
as FileNum, that is used to identify this open in all subsequent calls to
DataLoader/MX sequential I/O procedures. FileNum is not the same as the OSS file
descriptor or Guardian file number.
FileNum -1 indicates the file specified by the -I= parameter (not standard input).
FileNum -2 indicates the file specified by the -O= parameter (not standard output).
File numbers are used for DTLRead and DTLWrite procedures only.
There are no error returns. Errors are handled by DataLoader/MX.
DTLRead
This procedure reads a record up to MaxLen bytes from the file FileNum and places
those bytes into the buffer pointed to by Buf.
The syntax is:
If FileNum is -1, this procedure reads from the file specified in the -I= parameter.
The value returned by this procedure is the actual number of bytes read with a value of
-1 indicating EOF.
short DTLOpen( char* Name, char* AccessMode );
long DTLRead( short FileNum, char* Buf, long MaxLen );