GETMEDIA - find media code of file.

Alternate Entry Name: GT.MED

Usage:

B:
   ret = getmedia( unit );
C:
   int getmedia(FILE *unit);

Description:

GETMEDIA is used to find the media and/or report code of the file described by "unit". For input files, this will be the media and report code of the current record, which is the record that you are either in the middle of reading or have just read. For output files, this will be the media and report codes set by default or by a call to SET.MC.

If there is no current record because no read has yet been issued, the media and report code of the first record is returned. In this case, the record cannot be subsequently read by a record-oriented routine such as GETBIN, GETREC or GETRCP.

A -1 is returned if the file is at end-of-file, was never open, or if "unit" is illegal. Otherwise, the return value is the octal integer

0mmrr

where "mm" is the media code expressed as two octal digits and "rr" is the report code expressed as two octal digits.

See Also:

expl b lib set.mc

Copyright © 1996, Thinkage Ltd.