--- tar.c.original Sun Jun 11 18:40:20 2000 +++ tar.c Fri Sep 29 23:48:22 2000 @@ -47,8 +47,15 @@ #endif static void usage PARAMS ((int)); - + /* Miscellaneous. */ +#ifndef MAX_SIGNAL_FILE +# define MAX_SIGNAL_FILE 64 +#endif +char signal_file[MAX_SIGNAL_FILE]; +int use_signal_file = 0; + + /*------------------------------------------------------------------------. | Check if STRING is the decimal representation of number, and return its | @@ -258,6 +265,7 @@ {"same-owner", no_argument, &same_owner_option, 1}, {"same-permissions", no_argument, NULL, 'p'}, {"show-omitted-dirs", no_argument, &show_omitted_dirs_option, 1}, + {"signal-file", required_argument, NULL, 'j'}, {"sparse", no_argument, NULL, 'S'}, {"starting-file", required_argument, NULL, 'K'}, {"suffix", required_argument, NULL, SUFFIX_OPTION}, @@ -355,7 +363,14 @@ -L, --tape-length=NUM change tape after writing NUM x 1024 bytes\n\ -F, --info-script=FILE run script at end of each tape (implies -M)\n\ --new-volume-script=FILE same as -F FILE\n\ - --volno-file=FILE use/update the volume number in FILE\n"), + --volno-file=FILE use/update the volume number in FILE\n\ + --signal_file=FILE use the specified file's presence as the signal to\n\ + continue when a new tape is inserted, rather than the\n\ + default tty option. The first character of the file is read:\n\ + if it is 'y' or 'Y' then tar continues, otherwise tar terminates.\n\ + This option is useful for wrapper\n\ + applications to control tar by avoiding the blocking\n\ + that can happen whilst waiting for tty input.\n"), stdout); fputs (_("\ \n\ @@ -477,6 +492,7 @@ int input_files; /* number of input files */ const char *backup_suffix_string; const char *version_control_string; + int sf_nl; /* the size of the signal-filename */ /* Set some default option values. */ @@ -655,6 +671,13 @@ the record with garbage. */ ignore_zeros_option = 1; + break; + + case 'j': + /* the signal file */ + use_signal_file = 1; + strcpy(signal_file,optarg); +printf ("signal file is %s\n",signal_file); break; case 'k':