fdcp(1)
fdcp - Copies data while preserving record blocking
As shipped in IRIX 6.5.5. Added in IRIX 6.5.5.
NAME fdcp - Copies data while preserving record blocking SYNOPSIS fdcp [-a] [-c] [-F nfiles] [-f nmax] [-R n] [-r nmax] [-s] [-v] input output IMPLEMENTATION UNICOS, UNICOS/mk and IRIX systems DESCRIPTION The fdcp copy utility copies data and record structure from input to output. It is typically used to manipulate files that have record blocking and/or multifile structure. The files' blocking structure can be declared by using the assign(1) command. fdcp handles both byte stream and nonbyte stream files. If a file's structure has not been declared by assign(1), it is assumed to be a simple byte stream and is handled accordingly. Using fdcp when neither file has been declared by assign(1) produces the same data in the copied file as if the cp(1) command had been used. When a file's structure is declared by the -F option on assign(1), fdcp translates as much of the file structure of the input file(s) in the output file(s) as the declared file structure allows. Transformation is not performed on the data (for example, ASCII to EBCDIC conversion is not performed). The fdcp utility accepts the following options: -a Data is appended to output. output must be a single file name. -c Omit all end-of-file (EOF) records in the output file. If the output file is a format which requires a termination EOF record, then allow this one EOF record at the end. -F nfiles Number of files (EOFs) to skip before starting the copy operation. -f nmax Maximum number of files to copy once copying has started. If -r is not specified, the default value for nmax is everything up to end-of-data (EOD). If -r is specified, the default value for nmax is 1. -R n Number of records to skip before starting the copy operation. -r nmax Maximum number of records to copy after copying has started. -s Provides summary output. This option is similar to the -v option, but produces less output. -v Verbose output. Reports details of activity for records copied and skipped. Some example output follows: $ fdcp -v file1 file2 r= 1, l= 5 bytes (copied) r= 2, l= 8 bytes (copied) r= 3, l= 2 bytes (copied) r= 4, l= 7 bytes (copied) r= 5, l= 17 bytes (copied) r= 6, l= 23 bytes (copied) r= 7, l= 2 bytes (copied) EOD encountered 0 records, 0 files skipped 7 records, 0 files copied input output input and output are lists of one or more file names, but input and output cannot both be lists. The files in the list can be either whitespace or comma separated. If whitespace is used as a delimiter, the list must be quoted. Typically, input and output consist of one file name denoting the input and output files for a simple copy operation, which copies the logical structure of file input to file output. If output is a list of file names, fdcp splits input into its multifile parts, writing each portion of input up to an EOF to each file in the output list. If input is a list of file names, fdcp combines the listed files into one output file. An EOF record is added between each input file if the last record of the file was not an EOF record. The -F option is honored before the -f, -R, or -r options. The -R option is honored after the -F option but before the -f or -r option. The -f and -r options act as absolute limits on the amount of data to be transferred. NOTES The asgcmd(1) command can be used with fdcp instead of assign(1) on UNICOS systems. EXIT STATUS Returns 0 on success and 1 on failure. This command fails if parameters are inconsistent or if essential blocking structures cannot be faithfully reproduced. It is assumed that a request failed if a copy is requested, and the skip count forces no copy to be performed. EXAMPLES Example 1: The simplest use of fdcp is to copy a file. The following example assumes that the files have not been declared with assign(1). file2 becomes a bit-identical copy of file1. $ fdcp file1 file2 Example 2: This example demonstrates using fdcp to remove blocking control words from a Fortran sequential file. This might be necessary to use the data in an environment that does not allow for record blocking. As in all of these examples, it is assumed that no previous uses of assign(1) have declared any blocking characteristics for noblkfile. $ eval assign -F cos blockfile $ fdcp blockfile noblkfile Example 3 (UNICOS only): This example demonstrates copying a file from a tape where the tape contains fixed-length records (80-byte records blocked in 8000-byte blocks). The input tape is assumed to be ASCII and output should be in standard UNICOS text format (records separated by a new-line character). The resultant file myfile could be manipulated by using the usual UNICOS editors and text processors. $ FILENV=\$TMP ; export FILENV $ assign -F vms.f.tape:80:8000 tape $ assign -F text myfile $ fdcp tape myfile Example 4 (UNICOS only): This example shows how to copy the third file from an unlabeled, multifile tape to a disk file. The data on the tape is of unknown format, and the tape block boundaries need to be preserved. The COS specification on the disk file tells fdcp to preserve each tape block as a COS-blocked record. Only the third file is to be copied, and a maximum of 500 tape blocks is desired. On the fdcp command line, -F specifies the number of files to skip, -f specifies the number of files to copy, and -r specifies the number of records to copy. The output file will be in UNICOS standard Fortran unformatted (COS blocked) format: $ assign -F bmx tape $ assign -F cos diskfile $ fdcp -F 2 -f 1 -r 500 tape diskfile Example 5 (UNICOS only): In some cases, it is necessary to convert the native blocking on the Cray Research system to that of another machine before transferring the data to that machine. This example shows how to reblock a Fortran unformatted data file in VBS file format for writing to a labeled tape destined for an IBM computer system. It is assumed that any conversion on the data in the records has already been performed. fdcp does not convert data. $ assign -F cos datafile $ assign -F ibm.vbs ibmtape $ tpmnt -p ibmtape -l sl ...(and so on) $ fdcp datafile ibmtape Example 6: fdcp performs several tasks required when data contains multiple EOFs. If output is a list of file names, fdcp splits input into its multifile parts, as shown in this example. In this example, files are copied from an unlabeled tape to disk. File 1 is copied to disk file a, file 2 to disk file b, and so on. $ assign -F bmx mytape $ tpmnt -p mytape -T -l nl ... $ fdcp mytape a,b,c,d,e Example 7: If only a subset of files is needed, the -F and -f options can be used as shown in this example, where files 3 and 4 are copied from the tape and put in disk files c and d. $ fdcp -F 2 -f 2 mytape c,d Example 8: If input is a list of file names and output is a single file, fdcp performs the inverse of the previous example. To put five files into a single multifile COS-blocked dataset, execute the following, which writes five files to a dataset with an EOF separating each file from the next. The following two commands are identical, the first being a comma-separated list and the second being a whitespace-separated, quoted list. $ assign -F cos mfile $ fdcp a,b,c,d,e mfile $ fdcp 'a b c d e' mfile Example 9: The -a option lets you to append data to a file. For example, to put files d and e on the end of a COS-blocked dataset, execute the following: $ assign -F cos myfile $ fdcp a,b,c myfile $ fdcp -a d,e myfile Example 10: The method shown in example 9 works for single files, as shown in the following example, which creates a COS-blocked dataset containing five files: $ assign -F cos myfile $ fdcp a myfile $ fdcp -a b myfile $ fdcp -a c myfile $ fdcp -a d myfile $ fdcp -a e myfile Example 11: The preceding example, example 10, performs the same function as the following: $ assign -F cos myfile $ fdcp a,b,c,d,e myfile Example 12 (UNICOS only): The following example illustrates another way to get the identical results to the previous two examples. The listed files can be separated by commas or whitespace. Shell syntax demands that if whitespace is used, the list must be quoted. Therefore, lists can be put in files and special shell syntax can be used, as shown in the following example: $ eval `asgcmd -F cos myfile` $ cat > list << EOF a b c d e EOF $ fdcp `cat list` myfile SEE ALSO asgcmd(1), assign(1), cp(1), tpmnt(1) Application Programmer's I/O Guide This man page is available only online.