02/11/85 copy_file, cpf Syntax as a command: cpf in_control_arg out_control_arg {-control_args} Function: copies records from an input file to an output file that has been restructured for maximum compactness. The input and output file records must be structured (see "Notes on unstructured files" below). The input file can be copied either partially or in its entirety. Arguments: in_control_arg the input file from which records are read can be specified by either of the following: -input_switch STR, -isw STR specifies the input file by means of an already-attached I/O switch name, where STR is the switch name. -input_description STR, -ids STR specifies the input file by means of an attach description STR. STR must be enclosed in quotes if it contains spaces or other command language characters. out_control_arg the output file to which the records are written can be specified by either of the following: -output_switch STR, -osw STR specifies the output file by means of an already-attached I/O switch name, where STR is the switch name. -output_description STR, -ods STR specifies the output file by means of an attach description STR. STR must be enclosed in quotes if it contains spaces or other command language characters. Control arguments: -all, -a copies until the input file is exhausted. (Default) -brief, -bf suppresses a message indicating the number of records or lines actually copied. -count N, -ct N copies until N records have been copied or the input file is exhausted, whichever occurs first, where N is a positive integer. (Default: to copy until the input file is exhausted) -from N, -fm N copies records beginning with the Nth record of the input file, where N is a positive integer. (See "Notes.") (Default: to begin copying with the "next record") -keyed copies both records and keys from a keyed sequential input file to a keyed sequential output file. (See "Notes on keyed files.") (Default: to copy records from an input file, keyed or not, to a sequential output file) -long, -lg prints a message indicating the number of records or lines actually copied: "345 records copied". (Default) -start STR, -sr STR copies records beginning with the record whose key is STR, where STR is 256 or fewer ASCII characters. (Default: to begin copying with the "next record") -stop STR, -sp STR copies until the record whose key is STR has been copied or the input file is exhausted, whichever occurs first, where STR is 256 or fewer ASCII characters. This control argument can be given without specifying -start. However, if -start is supplied, the STR used with -stop must be greater than or equal to (according to the ASCII collating sequence) the STR given with -start. -to N copies until the Nth record has been copied or the input file is exhausted, whichever occurs first, where N is a positive integer greater than or equal to the N given with -from. If you use -to, you must give -from. Notes: If either the input or output specification is an attach description, it is used to attach a uniquely named I/O switch to the file. The switch is opened, the copy performed, and then the switch is closed and detached. Alternately the input or output file can be specified by an I/O switch name. Use either io_call or iox_ to attach the file prior to the invocation of copy_file. If the input file is specified by an I/O switch name and the switch is not open, copy_file opens it for (keyed_)sequential_input, performs the copy, and closes it. If the switch is already open when copy_file is invoked, the opening mode must be sequential_input, sequential_input_output, keyed_sequential_input, or keyed_sequential_update. The switch is not closed after the copy has been performed. The "next record" must be defined if neither -start nor -from is specified as the absolute starting position within the input file. If the I/O switch is opened by copy_file, the next record is the first record of the file; otherwise the next record is the one at which the file is positioned when copy_file is invoked. If the output file is specified by an I/O switch name and the switch is not open, copy_file opens it for (keyed_)sequential_output, performs the copy, and closes it. If the switch is already open when copy_file is invoked, the opening mode must be sequential_output, sequential_input_output, keyed_sequential_output, keyed_sequential_update, direct_output, or direct_update. (In update mode, output file records with keys that duplicate input file records are rewritten.) The switch is not closed after the copy has been performed. The following control arguments are mutually exclusive-- -from and -start; -to, -stop, -count, and -all; -brief and -long. Notes on unstructured files: This command operates by performing record I/O on structured files. If you want to copy from/to an unstructured file, you can use the record_stream_ I/O module: cpf -ids "record_stream_ -target vfile_ pathname" -osw OUT which takes lines from the file specified by pathname via the vfile_ I/O module, transforms them into records via the record_stream_ I/O module, and copies them to the I/O switch named OUT. Notes on keyed files: The command can copy a keyed sequential file to produce an output file that has been restructured for maximum compactness as a keyed file or as though it were sequential. By default it copies only records and does not place keys in the output file. To copy the keys, use -keyed. When you select -keyed the input file must be a keyed sequential file. Whether keys are copied or not, choose control arguments to delimit the range of records to be copied (e.g., -start, -stop). Copying is always performed in key order. If the keyed file has keys but no records (e.g., a dictionary file), the file, its keys, and its associated record descriptors are copied. ----------------------------------------------------------- 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