AFIO(1) UNIX Programmer's Manual AFIO(1) NAME afio - manipulate archives and files SYNOPSIS afio -o [ _o_p_t_i_o_n_s ] archive afio -t [ _o_p_t_i_o_n_s ] archive afio -i [ _o_p_t_i_o_n_s ] archive afio -p [ _o_p_t_i_o_n_s ] directory [ ... ] DESCRIPTION _A_f_i_o manipulates groups of files, copying them within the (collective) filesystem or between the filesystem and an _a_f_i_o archive. Note that _a_f_i_o archives are portable, as they contain only ASCII-formatted header information. They are also compatible with ASCII _c_p_i_o(1) archives (ala _c_p_i_o -_c). With -o, reads pathnames from the standard input and writes an _a_r_c_h_i_v_e. With -t, reads an _a_r_c_h_i_v_e and writes a table-of-contents to the standard output. With -i, installs the contents of an _a_r_c_h_i_v_e relative to the working directory. With -p, reads pathnames from the standard input and copies the files to each _d_i_r_e_c_t_o_r_y. Creates missing directories as necessary, with permissions to match their parents. Generates sparse filesystem blocks (with _l_s_e_e_k(2)) when pos- sible. Supports multi-volume archives during interactive operation (i.e., when /_d_e_v/_t_t_y is accessible and _S_I_G_I_N_T is not being ignored). Options: -b _s_i_z_e Read or write _s_i_z_e-character archive blocks. Suffices of b, k and m denote multiples of _5_1_2, _1_0_2_4 and _1_0_4_8_5_7_6, respectively. Defaults to _5_1_2_0 for compatibility with _c_p_i_o(1). -c _c_o_u_n_t Buffer _c_o_u_n_t archive blocks between I/O opera- tions. A large _c_o_u_n_t is recommended with streaming magnetic tape drives. -d Don't create missing directories. -e _b_o_u_n_d Pad the archive to a multiple of _b_o_u_n_d Printed 11/24/99 1 AFIO(1) UNIX Programmer's Manual AFIO(1) characters. Recognizes the same suffices as -s. Defaults to _1_x (the -b block size) for compatibility with _c_p_i_o(1). -f Spawn a child process to actually write to the archive; provides a clumsy form of double- buffering. Requires -s for multi-volume archive support. -g Change to input file directories. Avoids qua- dratic filesystem behavior with long similar pathnames. Requires all absolute pathnames, including those for the -o _a_r_c_h_i_v_e and the -p _d_i_r_e_c_t_o_r_i_e_s. -h Follow symbolic links, treating them as ordi- nary files and directories. -j Don't generate sparse filesystem blocks. -k Skip corrupt data at the _b_e_g_i_n_n_i_n_g of an archive (rather than complaining about unrecog- nizable input). -l With -o, write file contents with each hard link. With -t, report hard links. With -p, attempt to link files rather than copying them. -m Mark output files with a common current times- tamp (rather than with input file modification times). -n Protect newer existing files (comparing file modification times). -s _l_i_m_i_t Restrict each portion of a multi-volume archive to _l_i_m_i_t characters. Recognizes the same suf- fices as -b. Also, the suffix x denotes a mul- tiple of the -b block size (and must follow any -b specification). Useful with finite-length devices which do not return short counts at end of media (sigh); output to magnetic tape typi- cally falls into this category. -u Report files with unseen links. -v Verbose. Report pathnames as they are pro- cessed. With -t, gives an _l_s -_l style report Printed 11/24/99 2 AFIO(1) UNIX Programmer's Manual AFIO(1) (including link information). -x Retain file ownership and setuid/setgid permis- sions. This is the default for the super-user; he may use -X to override it. -y _p_r_e_f_i_x Restrict archive processing to names beginning with _p_r_e_f_i_x. Specify once for each prefix to be recognized. Use -Y to supply prefixes which are _n_o_t to be processed. -z Print execution statistics. This is meant for human consumption; use by other programs is officially discouraged. Special-case archive names: o Specify - to read or write the standard input or out- put, respectively. This disables multi-volume archive handling. o Prefix a command string to be executed with an excla- mation mark (!). The command is executed once for each archive volume, with its standard input or output piped to _a_f_i_o. It is expected to produce a zero exit code when all is well. o Use _s_y_s_t_e_m:_f_i_l_e to access an archive in _f_i_l_e on _s_y_s_- _t_e_m. This is really just a special case of pipelin- ing. It requires a 4.2BSD-style remote shell (_r_s_h(1C)) and a remote copy of _a_f_i_o. o Anything else specifies a local file or device. An output file will be created if it does not already exist. Recognizes obsolete binary _c_p_i_o(1) archives (including those from machines with reversed byte order), but cannot write them. Recovers from archive corruption by searching for a valid magic number. This is rather simplistic, but, much like a disassembler, almost always works. Optimizes pathnames with respect to the current and parent directories. For example, ./_s_r_c/_s_h/../_m_i_s_c/_a_f_i_o._c becomes _s_r_c/_m_i_s_c/_a_f_i_o._c. BUGS There are too many options. Printed 11/24/99 3 AFIO(1) UNIX Programmer's Manual AFIO(1) Restricts pathnames to 1023 characters and 255 meaningful elements. There is no sequence information within multi-volume archives. Input sequence errors generally masquerade as data corruption. A solution would probably be mutually exclusive with _c_p_i_o(1) compatibility. Degenerate uses of symbolic links are mangled by pathname optimization. For example, assuming that "usr.src" is a symbolic link to "/usr/src", the pathname "usr.src/../bin/cu" is mis-optimized into "bin/cu" (rather than "/usr/bin/cu"). SEE ALSO cpio(1), find(1), tar(1), tp(1). AUTHOR Mark Brukhartz ..!_i_h_n_p_4!_l_a_i_d_b_a_k!_m_d_b Printed 11/24/99 4