-#if 0
- long offset, numbytes;
-#endif
- if (multi_volume_option)
- {
- assign_string (&save_name, current_file_name);
- save_totsize = current_stat.st_size;
- save_sizeleft = size;
- }
-
- /* Locate data, determine max length writeable, write it,
- block that we have used the data, then check if the write
- worked. */
-
- data_block = find_next_block ();
- if (data_block == NULL)
- {
- ERROR ((0, 0, _("Unexpected EOF on archive file")));
- break; /* FIXME: What happens, then? */
- }
-
- /* 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 0
- if (current_header->header.typeflag == GNUTYPE_SPARSE)
- {
- off_t pos;
-
- pos = lseek (fd, (off_t) sparsearray[sparse_ind].offset, 0);
- fprintf (msg_file, _("%d at %d\n"), (int) pos, sparse_ind);
- written = sparsearray[sparse_ind++].numbytes;
- }
- else
-#endif
- written = available_space_after (data_block);
-
- if (written > size)
- written = size;
- errno = 0; /* FIXME: errno should be read-only */
- status = write (fd, data_block->buffer, (size_t) written);
-
- set_next_block_after ((union block *)
- (data_block->buffer + written - 1));
- if (status == written)
- continue;
-
- /* Error in writing to file. Print it, skip to next file in
- archive. */
-
- if (status < 0)
- ERROR ((0, errno, _("%s: Could not write to file"),
- CURRENT_FILE_NAME));
- else
- ERROR ((0, 0, _("%s: Could only write %d of %d bytes"),
- CURRENT_FILE_NAME, status, written));
- skip_file ((long) (size - written));
- break; /* still do the close, mod time, chmod, etc */