- /* long offset,
- numbytes;*/
-
- if (f_multivol)
- {
- save_name = current_file_name;
- save_totsize = hstat.st_size;
- save_sizeleft = size;
- }
-
- /*
- * Locate data, determine max length
- * writeable, write it, record that
- * we have used the data, then check
- * if the write worked.
- */
- data = findrec ()->charptr;
- if (data == NULL)
- { /* Check it... */
- msg ("Unexpected EOF on archive file");
- break;
- }
- /*
- * JK - If the file is sparse, use the sparsearray
- * that we created before to lseek into the new
- * file the proper amount, and to see how many
- * bytes we want to write at that position.
- */
- /* if (head->header.linkflag == LF_SPARSE) {
- off_t pos;
-
- pos = lseek(fd, (off_t) sparsearray[sparse_ind].offset, 0);
- printf("%d at %d\n", (int) pos, sparse_ind);
- written = sparsearray[sparse_ind++].numbytes;
- } else*/
- written = endofrecs ()->charptr - data;
- if (written > size)
- written = size;
- errno = 0;
- check = write (fd, data, written);
- /*
- * The following is in violation of strict
- * typing, since the arg to userec
- * should be a struct rec *. FIXME.
- */
- userec ((union record *) (data + written - 1));
- if (check == written)
- continue;
- /*
- * Error in writing to file.
- * Print it, skip to next file in archive.
- */
- if (check < 0)
- msg_perror ("couldn't write to file %s",
- skipcrud + current_file_name);
- else
- msg ("could only write %d of %d bytes to file %s",
- check, written, skipcrud + current_file_name);
- skip_file ((long) (size - written));
- break; /* Still do the close, mod time, chmod, etc */