fdcp(1)

fdcp - Copies data while preserving record blocking

Showing IRIX 6.5.30 (default release). Last changed in IRIX 6.5.19.

NAME
     fdcp - Copies data while preserving record blocking

SYNOPSIS
     fdcp [-a] [-c] [-F nfiles] [-f nmax] [-R n] [-r nmax] [-s] [-v] input
     output

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.

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:

     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:

     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:

     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:

     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:

     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:

     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

SEE ALSO
     assign(1), cp(1), tpmnt(1)

     MIPSpro Application Programmer's I/O Guide