2 * Copyright (c) 1992 Keith Muller.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
6 * This code is derived from software contributed to Berkeley by
7 * Keith Muller of the University of California, San Diego.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * @(#)options.c 8.2 (Berkeley) 4/18/94
34 * $FreeBSD: src/bin/pax/options.c,v 1.13.2.3 2001/08/01 05:03:11 obrien Exp $
35 * $DragonFly: src/bin/pax/options.c,v 1.9 2008/06/05 18:06:30 swildner Exp $
38 #include <sys/types.h>
55 * Routines which handle command line options
58 static char flgch[] = FLGCH; /* list of all possible flags */
59 static OPLIST *ophead = NULL; /* head for format specific options -x */
60 static OPLIST *optail = NULL; /* option tail */
62 static int no_op (void);
63 static void printflg (unsigned int);
64 static int c_frmt (const void *, const void *);
65 static off_t str_offt (char *);
66 static char *getline (FILE *);
67 static void pax_options (int, char **);
68 static void pax_usage (void);
69 static void tar_options (int, char **);
70 static void tar_usage (void);
71 static void cpio_options (int, char **);
72 static void cpio_usage (void);
73 static int mkpath(char *);
75 /* errors from getline */
76 #define GETLINE_FILE_CORRUPT 1
77 #define GETLINE_OUT_OF_MEM 2
78 static int getline_error;
81 #define GZIP_CMD "gzip" /* command to run as gzip */
82 #define COMPRESS_CMD "compress" /* command to run as compress */
83 #define BZIP2_CMD "bzip2" /* command to run as gzip */
86 * Format specific routine table - MUST BE IN SORTED ORDER BY NAME
87 * (see pax.h for description of each function)
89 * name, blksz, hdsz, udev, hlk, blkagn, inhead, id, st_read,
90 * read, end_read, st_write, write, end_write, trail,
91 * rd_data, wr_data, options
95 /* 0: OLD BINARY CPIO */
96 {"bcpio", 5120, sizeof(HD_BCPIO), 1, 0, 0, 1, bcpio_id, cpio_strd,
97 bcpio_rd, bcpio_endrd, cpio_stwr, bcpio_wr, cpio_endwr, cpio_trail,
98 rd_wrfile, wr_rdfile, bad_opt},
100 /* 1: OLD OCTAL CHARACTER CPIO */
101 {"cpio", 5120, sizeof(HD_CPIO), 1, 0, 0, 1, cpio_id, cpio_strd,
102 cpio_rd, cpio_endrd, cpio_stwr, cpio_wr, cpio_endwr, cpio_trail,
103 rd_wrfile, wr_rdfile, bad_opt},
105 /* 2: SVR4 HEX CPIO */
106 {"sv4cpio", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, vcpio_id, cpio_strd,
107 vcpio_rd, vcpio_endrd, cpio_stwr, vcpio_wr, cpio_endwr, cpio_trail,
108 rd_wrfile, wr_rdfile, bad_opt},
110 /* 3: SVR4 HEX CPIO WITH CRC */
111 {"sv4crc", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, crc_id, crc_strd,
112 vcpio_rd, vcpio_endrd, crc_stwr, vcpio_wr, cpio_endwr, cpio_trail,
113 rd_wrfile, wr_rdfile, bad_opt},
116 {"tar", 10240, BLKMULT, 0, 1, BLKMULT, 0, tar_id, no_op,
117 tar_rd, tar_endrd, no_op, tar_wr, tar_endwr, tar_trail,
118 rd_wrfile, wr_rdfile, tar_opt},
121 {"ustar", 10240, BLKMULT, 0, 1, BLKMULT, 0, ustar_id, ustar_strd,
122 ustar_rd, tar_endrd, ustar_stwr, ustar_wr, tar_endwr, tar_trail,
123 rd_wrfile, wr_rdfile, bad_opt},
125 #define F_OCPIO 0 /* format when called as cpio -6 */
126 #define F_ACPIO 1 /* format when called as cpio -c */
127 #define F_CPIO 3 /* format when called as cpio */
128 #define F_OTAR 4 /* format when called as tar -o */
129 #define F_TAR 5 /* format when called as tar */
130 #define DEFLT 5 /* default write format from list above */
133 * ford is the archive search order used by get_arc() to determine what kind
134 * of archive we are dealing with. This helps to properly id archive formats
135 * some formats may be subsets of others....
137 int ford[] = {5, 4, 3, 2, 1, 0, -1 };
141 * figure out if we are pax, tar or cpio. Call the appropriate options
146 options(int argc, char **argv)
150 * Are we acting like pax, tar or cpio (based on argv[0])
152 if ((argv0 = strrchr(argv[0], '/')) != NULL)
157 if (strcmp(NM_TAR, argv0) == 0)
158 return(tar_options(argc, argv));
159 else if (strcmp(NM_CPIO, argv0) == 0)
160 return(cpio_options(argc, argv));
162 * assume pax as the default
165 return(pax_options(argc, argv));
170 * look at the user specified flags. set globals as required and check if
171 * the user specified a legal set of flags. If not, complain and exit
175 pax_options(int argc, char **argv)
179 unsigned int flg = 0;
180 unsigned int bflg = 0;
185 * process option flags
187 while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ"))
201 if ((wrblksz = (int)str_offt(optarg)) <= 0) {
202 paxwarn(1, "Invalid block size %s", optarg);
208 * inverse match on patterns
215 * match only dir on extract, not the subtree at dir
222 * filename where the archive is stored
229 * interactive file rename
236 * do not clobber files that exist
243 * try to link src to dest with copy (-rw)
250 * select first match for a pattern only
257 * pass format specific options
260 if (opt_add(optarg) < 0)
265 * specify file characteristic options
267 for (pt = optarg; *pt != '\0'; ++pt) {
271 * do not preserve access time
277 * preserve user id, group id, file
278 * mode, access/modification times
287 * do not preserve modification time
299 * preserve file mode bits
304 paxwarn(1, "Invalid -p string: %c", *pt);
319 * file name substitution name pattern
321 if (rep_add(optarg) < 0) {
329 * preserve access time on filesystem nodes we read
336 * ignore those older files
343 * verbose operation mode
356 * specify an archive format on write
359 if ((frmt = (FSUB *)bsearch((void *)&tmp, (void *)fsub,
360 sizeof(fsub)/sizeof(FSUB), sizeof(FSUB), c_frmt)) != NULL) {
364 paxwarn(1, "Unknown -x format: %s", optarg);
365 fputs("pax: Known -x formats are:", stderr);
366 for (i = 0; i < (sizeof(fsub)/sizeof(FSUB)); ++i)
367 fprintf(stderr, " %s", fsub[i].name);
368 fputs("\n\n", stderr);
373 * use gzip. Non standard option.
375 gzip_program = GZIP_CMD;
379 * non-standard option on number of bytes written on a
380 * single archive volume.
382 if ((wrlimit = str_offt(optarg)) <= 0) {
383 paxwarn(1, "Invalid write limit %s", optarg);
386 if (wrlimit % BLKMULT) {
387 paxwarn(1, "Write limit is not a %d byte multiple",
395 * On extraction check file inode change time before the
396 * modification of the file name. Non standard option.
403 * non-standard limit on read faults
404 * 0 indicates stop after first error, values
405 * indicate a limit, "NONE" try forever
408 if (strcmp(NONE, optarg) == 0)
410 else if ((maxflt = atoi(optarg)) < 0) {
411 paxwarn(1, "Error count value must be positive");
417 * non-standard option for selecting files within an
418 * archive by group (gid or name)
420 if (grp_add(optarg) < 0) {
428 * follow command line symlinks only
442 * Force one volume. Non standard option.
444 force_one_volume = 1;
448 * do NOT follow symlinks (default)
455 * non-standard option for selecting files within an
456 * archive by modification time range (lower,upper)
458 if (trng_add(optarg) < 0) {
466 * non-standard option for selecting files within an
467 * archive by user (uid or name)
469 if (usr_add(optarg) < 0) {
477 * do not pass over mount points in the file system
484 * On extraction check file inode change time after the
485 * modification of the file name. Non standard option.
492 * On extraction check modification time after the
493 * modification of the file name. Non standard option.
505 * figure out the operation mode of pax read,write,extract,copy,append
506 * or list. check that we have not been given a bogus set of flags
507 * for the operation mode.
513 } else if (ISEXTRACT(flg)) {
516 } else if (ISARCHIVE(flg)) {
519 } else if (ISAPPND(flg)) {
522 } else if (ISCOPY(flg)) {
533 * if we are writing (ARCHIVE) we use the default format if the user
534 * did not specify a format. when we write during an APPEND, we will
535 * adopt the format of the existing archive if none was supplied.
537 if (!(flg & XF) && (act == ARCHIVE))
538 frmt = &(fsub[DEFLT]);
541 * process the args as they are interpreted by the operation mode
546 for (; optind < argc; optind++)
547 if (pat_add(argv[optind], NULL) < 0)
551 if (optind >= argc) {
552 paxwarn(0, "Destination directory was not supplied");
557 if (mkpath(dirptr) < 0)
562 for (; optind < argc; optind++)
563 if (ftree_add(argv[optind], 0) < 0)
566 * no read errors allowed on updates/append operation!
576 * look at the user specified flags. set globals as required and check if
577 * the user specified a legal set of flags. If not, complain and exit
581 tar_options(int argc, char **argv)
587 int incfiles_max = 0;
592 struct incfile *incfiles = NULL;
595 * Set default values.
600 * process option flags
602 while ((c = getoldopt(argc, argv,
603 "b:cef:hjmopqruts:vwxyzBC:HI:LOPXZ014578")) != -1) {
607 * specify blocksize in 512-byte blocks
609 if ((wrblksz = (int)str_offt(optarg)) <= 0) {
610 paxwarn(1, "Invalid block size %s", optarg);
613 wrblksz *= 512; /* XXX - check for int oflow */
623 * stop after first error
629 * filename where the archive is stored
631 if ((optarg[0] == '-') && (optarg[1]== '\0')) {
651 * use bzip2. Non standard option.
653 gzip_program = BZIP2_CMD;
657 * do not preserve modification time
662 if (opt_add("write_opt=nodir") < 0)
669 * preserve uid/gid and file mode, regardless of umask
676 * select first match for a pattern only
683 * append to the archive
689 * file name substitution name pattern
691 if (rep_add(optarg) < 0) {
698 * list contents of the tape
704 * verbose operation mode
710 * interactive file rename
716 * extract an archive, preserving mode,
717 * and mtime if possible.
724 * use gzip. Non standard option.
726 gzip_program = GZIP_CMD;
730 * Nothing to do here, this is pax default
738 * follow command line symlinks only
743 if (++nincfiles > incfiles_max) {
744 incfiles_max = nincfiles + 3;
745 incfiles = realloc(incfiles,
746 sizeof(*incfiles) * incfiles_max);
747 if (incfiles == NULL) {
748 paxwarn(0, "Unable to allocate space "
753 incfiles[nincfiles - 1].file = optarg;
754 incfiles[nincfiles - 1].dir = chdname;
764 * do not remove leading '/' from pathnames
770 * do not pass over mount points in the file system
778 gzip_program = COMPRESS_CMD;
806 /* Traditional tar behaviour (pax uses stderr unless in list mode) */
807 if (fstdin == 1 && act == ARCHIVE)
812 /* Traditional tar behaviour (pax wants to read file list from stdin) */
813 if ((act == ARCHIVE || act == APPND) && argc == 0 && nincfiles == 0)
817 * if we are writing (ARCHIVE) specify tar, otherwise run like pax
818 * (unless -o specified)
820 if (act == ARCHIVE || act == APPND)
821 frmt = &(fsub[Oflag ? F_OTAR : F_TAR]);
823 paxwarn(1, "The -O/-o options are only valid when writing an archive");
824 tar_usage(); /* only valid when writing */
828 * process the args as they are interpreted by the operation mode
836 char *file, *dir = NULL;
838 while (nincfiles || *argv != NULL) {
840 * If we queued up any include files,
841 * pull them in now. Otherwise, check
842 * for -I and -C positional flags.
843 * Anything else must be a file to
847 file = incfiles->file;
851 } else if (strcmp(*argv, "-I") == 0) {
862 if (strcmp(file, "-") == 0)
864 else if ((fp = fopen(file, "r")) == NULL) {
865 paxwarn(1, "Unable to open file '%s' for read", file);
868 while ((str = getline(fp)) != NULL) {
869 if (pat_add(str, dir) < 0)
873 if (strcmp(file, "-") != 0)
876 paxwarn(1, "Problem with file '%s'", file);
879 } else if (strcmp(*argv, "-C") == 0) {
883 } else if (pat_add(*argv++, chdname) < 0)
889 * if patterns were added, we are doing chdir()
890 * on a file-by-file basis, else, just one
891 * global chdir (if any) after opening input.
899 if (chdname != NULL) { /* initial chdir() */
900 if (ftree_add(chdname, 1) < 0)
904 while (nincfiles || *argv != NULL) {
905 char *file, *dir = NULL;
908 * If we queued up any include files, pull them in
909 * now. Otherwise, check for -I and -C positional
910 * flags. Anything else must be a file to include
914 file = incfiles->file;
918 } else if (strcmp(*argv, "-I") == 0) {
929 /* Set directory if needed */
931 if (ftree_add(dir, 1) < 0)
935 if (strcmp(file, "-") == 0)
937 else if ((fp = fopen(file, "r")) == NULL) {
938 paxwarn(1, "Unable to open file '%s' for read", file);
941 while ((str = getline(fp)) != NULL) {
942 if (ftree_add(str, 0) < 0)
945 if (strcmp(file, "-") != 0)
948 paxwarn(1, "Problem with file '%s'",
952 } else if (strcmp(*argv, "-C") == 0) {
955 if (ftree_add(*argv++, 1) < 0)
957 } else if (ftree_add(*argv++, 0) < 0)
961 * no read errors allowed on updates/append operation!
966 if (!fstdin && ((arcname == NULL) || (*arcname == '\0'))) {
967 arcname = getenv("TAPE");
968 if ((arcname == NULL) || (*arcname == '\0'))
969 arcname = _PATH_DEFTAPE;
983 slash += strspn(slash, "/");
984 slash += strcspn(slash, "/");
986 done = (*slash == '\0');
989 if (stat(path, &sb)) {
990 if (errno != ENOENT || mkdir(path, 0777)) {
991 paxwarn(1, "%s", path);
994 } else if (!S_ISDIR(sb.st_mode)) {
995 syswarn(1, ENOTDIR, "%s", path);
1007 * look at the user specified flags. set globals as required and check if
1008 * the user specified a legal set of flags. If not, complain and exit
1012 cpio_options(int argc, char **argv)
1027 while ((c=getopt(argc,argv,"abcdfiklmoprstuvzABC:E:F:H:I:LO:SZ6")) != -1)
1031 * preserve access time on files read
1037 * swap bytes and half-words when reading data
1044 frmt = &(fsub[F_ACPIO]);
1048 * create directories as needed
1054 * invert meaning of pattern list
1060 * restore an archive
1068 * use links instead of copies when possible
1074 * preserve modification time
1083 frmt = &(fsub[F_CPIO]);
1093 * interactively rename files
1099 * swap bytes after reading data
1104 * list contents of archive
1111 * replace newer files
1117 * verbose operation mode
1123 * use gzip. Non standard option.
1125 gzip_program = GZIP_CMD;
1135 * Use 5120 byte block size
1141 * set block size in bytes
1143 wrblksz = atoi(optarg);
1147 * file with patterns to extract or list
1149 if ((fp = fopen(optarg, "r")) == NULL) {
1150 paxwarn(1, "Unable to open file '%s' for read", optarg);
1153 while ((str = getline(fp)) != NULL) {
1157 if (getline_error) {
1158 paxwarn(1, "Problem with file '%s'", optarg);
1166 * filename where the archive is stored
1168 if ((optarg[0] == '-') && (optarg[1]== '\0')) {
1170 * treat a - as stdin
1179 * specify an archive format on write
1182 if ((frmt = (FSUB *)bsearch((void *)&tmp, (void *)fsub,
1183 sizeof(fsub)/sizeof(FSUB), sizeof(FSUB), c_frmt)) != NULL)
1185 paxwarn(1, "Unknown -H format: %s", optarg);
1186 fputs("cpio: Known -H formats are:", stderr);
1187 for (i = 0; i < (sizeof(fsub)/sizeof(FSUB)); ++i)
1188 fprintf(stderr, " %s", fsub[i].name);
1189 fputs("\n\n", stderr);
1194 * follow symbolic links
1200 * swap halfwords after reading data
1205 * use compress. Non standard option.
1207 gzip_program = COMPRESS_CMD;
1211 * process Version 6 cpio format
1213 frmt = &(fsub[F_OCPIO]);
1224 * process the args as they are interpreted by the operation mode
1229 while (*argv != NULL)
1230 if (pat_add(*argv++, NULL) < 0)
1234 if (*argv == NULL) {
1235 paxwarn(0, "Destination directory was not supplied");
1239 if (mkpath(dirptr) < 0)
1249 * no read errors allowed on updates/append operation!
1252 while ((str = getline(stdin)) != NULL) {
1255 if (getline_error) {
1256 paxwarn(1, "Problem while reading stdin");
1268 * print out those invalid flag sets found to the user
1272 printflg(unsigned int flg)
1277 fprintf(stderr,"%s: Invalid combination of options:", argv0);
1278 while ((nxt = ffs(flg)) != 0) {
1281 fprintf(stderr, " -%c", flgch[pos-1]);
1288 * comparison routine used by bsearch to find the format specified
1293 c_frmt(const void *a, const void *b)
1295 return(strcmp(((FSUB *)a)->name, ((FSUB *)b)->name));
1300 * called by format specific options routines to get each format specific
1301 * flag and value specified with -o
1303 * pointer to next OPLIST entry or NULL (end of list).
1311 if ((opt = ophead) != NULL)
1312 ophead = ophead->fow;
1318 * generic routine used to complain about a format specific options
1319 * when the format does not support options.
1330 * print all we were given
1332 paxwarn(1,"These format options are not supported");
1333 while ((opt = opt_next()) != NULL)
1334 fprintf(stderr, "\t%s = %s\n", opt->name, opt->value);
1341 * breaks the value supplied to -o into a option name and value. options
1342 * are given to -o in the form -o name-value,name=value
1343 * multiple -o may be specified.
1345 * 0 if format in name=value format, -1 if -o is passed junk
1356 if ((str == NULL) || (*str == '\0')) {
1357 paxwarn(0, "Invalid option name");
1360 if ((str = strdup(str)) == NULL) {
1361 paxwarn(0, "Unable to allocate space for option list");
1367 * break into name and values pieces and stuff each one into a
1368 * OPLIST structure. When we know the format, the format specific
1369 * option function will go through this list
1371 while ((frpt != NULL) && (*frpt != '\0')) {
1372 if ((endpt = strchr(frpt, ',')) != NULL)
1374 if ((pt = strchr(frpt, '=')) == NULL) {
1375 paxwarn(0, "Invalid options format");
1379 if ((opt = (OPLIST *)malloc(sizeof(OPLIST))) == NULL) {
1380 paxwarn(0, "Unable to allocate space for option list");
1392 if (ophead == NULL) {
1393 optail = ophead = opt;
1404 * Convert an expression of the following forms to an off_t > 0.
1405 * 1) A positive decimal number.
1406 * 2) A positive decimal number followed by a b (mult by 512).
1407 * 3) A positive decimal number followed by a k (mult by 1024).
1408 * 4) A positive decimal number followed by a m (mult by 512).
1409 * 5) A positive decimal number followed by a w (mult by sizeof int)
1410 * 6) Two or more positive decimal numbers (with/without k,b or w).
1411 * separated by x (also * for backwards compatibility), specifying
1412 * the product of the indicated values.
1414 * 0 for an error, a positive value o.w.
1423 num = strtoq(val, &expr, 0);
1424 if ((num == QUAD_MAX) || (num <= 0) || (expr == val))
1464 num *= str_offt(expr + 1);
1480 name = fgetln(f, &len);
1482 getline_error = ferror(f) ? GETLINE_FILE_CORRUPT : 0;
1485 if (name[len-1] != '\n')
1489 getline_error = GETLINE_OUT_OF_MEM;
1492 memcpy(temp, name, len-1);
1499 * for those option functions where the archive format has nothing to do.
1512 * print the usage summary to the user
1518 fputs("usage: pax [-cdnvz] [-E limit] [-f archive] ", stderr);
1519 fputs("[-s replstr] ... [-U user] ...", stderr);
1520 fputs("\n [-G group] ... ", stderr);
1521 fputs("[-T [from_date][,to_date]] ... ", stderr);
1522 fputs("[pattern ...]\n", stderr);
1523 fputs(" pax -r [-cdiknuvzDYZ] [-E limit] ", stderr);
1524 fputs("[-f archive] [-o options] ... \n", stderr);
1525 fputs(" [-p string] ... [-s replstr] ... ", stderr);
1526 fputs("[-U user] ... [-G group] ...\n ", stderr);
1527 fputs("[-T [from_date][,to_date]] ... ", stderr);
1528 fputs(" [pattern ...]\n", stderr);
1529 fputs(" pax -w [-dituvzHLPX] [-b blocksize] ", stderr);
1530 fputs("[ [-a] [-f archive] ] [-x format] \n", stderr);
1531 fputs(" [-B bytes] [-s replstr] ... ", stderr);
1532 fputs("[-o options] ... [-U user] ...", stderr);
1533 fputs("\n [-G group] ... ", stderr);
1534 fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
1535 fputs("[file ...]\n", stderr);
1536 fputs(" pax -r -w [-diklntuvDHLPXYZ] ", stderr);
1537 fputs("[-p string] ... [-s replstr] ...", stderr);
1538 fputs("\n [-U user] ... [-G group] ... ", stderr);
1539 fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
1540 fputs("\n [file ...] directory\n", stderr);
1546 * print the usage summary to the user
1552 fputs("usage: tar [-]{crtux}[-befhjmopqsvwyzHLOPXZ014578] [blocksize] ",
1554 fputs("[archive] [replstr] [-C directory] [-I file] [file ...]\n",
1561 * print the usage summary to the user
1567 fputs("usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr);
1568 fputs(" [-F archive] < name-list [> archive]\n", stderr);
1569 fputs(" cpio -i [-bBcdfmnrsStuvVzZ6] [-C bytes] [-E file] [-H format]\n", stderr);
1570 fputs(" [-I archive] [-F archive] [pattern...] [< archive]\n", stderr);
1571 fputs(" cpio -p [-adlLmuvV] destination-directory < name-list\n", stderr);