02/06/84 record_stream_ Syntax for attach description: record_stream_ {switch_name} {-control_args} Function: The record_stream_ I/O module attaches an I/O switch to a target I/O switch so that record I/O operations on the attached switch are translated into stream I/O operations on the target switch, or so that stream I/O operations on the attached switch are translated into record I/O operations on the target switch. In this way a program that uses only record I/O may process unstructured files and do I/O from/to the terminal. Similarly, a program that uses only stream I/O can process some structured files. Entry points in this module are not called directly by users; rather the module is accessed through the I/O system. Arguments: switch_name is the name of the target I/O switch. It need not be attached when this attachment is made. If this argument is omitted, the -target control argument must be present. Control arguments: The following control the transformation of records into a stream of bytes and vice versa, or control the target attachment. -nnl transforms a record into a stream without appending a newline character. -length N converts the stream of bytes to a sequence of records each of which has length N. -target attach_descrip specifies the attachment of a uniquely named target switch. This control argument must occur if and only if the switch_name argument is omitted, and it must be the last control argument in the attach description, if present. Notes: If neither the -nnl nor -length control arguments are given, lines are transformed into records after deleting trailing newlines and records are transformed into lines by appending newlines. List of opening modes: stream_input The target I/O switch must be either open for sequential_input, open for sequential_input_output, or attached and closed. In the last case, it is opened for sequential_input. The sequence of records read from the target switch is transformed into a stream of bytes that are transmitted to the calling program by the get_line and get_chars operations. The read_record operation is used to read the records from the target switch. stream_output The target I/O switch must be either open for sequential_output, open for sequential_input_output, or attached and closed. In the last case, it is opened for sequential_output. The stream of bytes written to the attached switch by the put_chars operation is transformed into a sequence of records that are written to the target switch by use of the write_record operation. sequential_input The target I/O switch must be either open for stream_input, open for stream_input_output, or attached and closed. In the last case, it is opened for stream_input. The stream of bytes read from the target switch is transformed into a sequence of records that are transmitted to the calling program by read_record operations. If the attach description specifies the default line to record transformation, the get_line operation is used to read bytes from the target switch. If the attach description specifies the -length control argument, the get_chars operation is used to read bytes from the target switch. sequential_output The target I/O switch must be either open for stream_output, open for stream_input_output, or attached and closed. In the last case, it is opened for stream_output. The sequence of bytes written to the attached switch by the write_record operation is transformed into a stream of bytes that are written to the target switch by use of the put_chars operation. Notes on transformations: The transformation from record to stream form can be described in terms of taking records from a record switch and giving bytes to a stream switch, and similarly for stream to record (a record is a string of bytes). Which switch is the record switch and which the stream switch depends on the opening mode. The details are as follows: Record to stream (default) A record is taken from the record switch, a newline character is appended, and the resulting string is given to the stream switch. -nnl A record is taken from the record switch and given to the stream switch without modification. Stream to record (default) A line (string of bytes ending with a newline character) is taken from the stream switch, the newline character is deleted, and the resulting string is given to the record switch. -length N To form a record, N bytes are taken from the stream switch and given to the record switch as one record. Notes on buffering: The I/O module may hold data in buffers between operations when the switch is opened for stream_output, stream_input, or sequential_input. Close operation: The I/O module closes the target switch if and only if the I/O module opened it. Detach operation: The I/O module detaches the target switch if and only if the I/O module attached it via the -target control argument. Position operation: Only positioning to the beginning of file or end of file and skipping forward are supported, except in the default sequential case, which also permits backward skipping. These operations are only supported to the extent the attachment of the target I/O switch supports them. Control and modes operations: These are supported for open switches in the sense that they are passed along to the I/O module for the target switch. Notes on I/O status: In addition to the I/O status codes specified in the description of the iox_ subroutine for the various I/O operations, this I/O module returns codes returned by the target switch I/O module. ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved