1 /* List a tar archive, with support routines for reading a tar archive.
2 Copyright 1988,92,93,94,96,97,98,1999 Free Software Foundation, Inc.
3 Written by John Gilmore, on 1985-08-26.
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2, or (at your option) any later
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
13 Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 59 Place - Suite 330, Boston, MA 02111-1307, USA. */
19 /* Define to non-zero for forcing old ctime() instead of isotime(). */
28 #define ISODIGIT(Char) \
29 ((unsigned char) (Char) >= '0' && (unsigned char) (Char) <= '7')
30 #define ISSPACE(Char) (ISASCII (Char) && isspace (Char))
32 #ifndef FNM_LEADING_DIR
38 union block
*current_header
; /* points to current archive header */
39 struct stat current_stat
; /* stat struct corresponding */
40 enum archive_format current_format
; /* recognized format */
42 static uintmax_t from_oct
PARAMS ((const char *, size_t, const char *, uintmax_t));
45 /*-----------------------------------.
46 | Main loop for reading an archive. |
47 `-----------------------------------*/
50 read_and (void (*do_something
) ())
52 enum read_header status
= HEADER_STILL_UNREAD
;
53 enum read_header prev_status
;
57 open_archive (ACCESS_READ
);
62 status
= read_header ();
65 case HEADER_STILL_UNREAD
:
70 /* Valid header. We should decode next field (mode) first.
71 Ensure incoming names are null terminated. */
73 if (ending_file_option
&&
74 fnmatch (ending_file_option
, current_file_name
,
75 FNM_LEADING_DIR
) == 0) {
79 /* FIXME: This is a quick kludge before 1.12 goes out. */
80 current_stat
.st_mtime
= TIME_FROM_OCT (current_header
->header
.mtime
);
82 if (!name_match (current_file_name
)
83 || current_stat
.st_mtime
< newer_mtime_option
84 || (exclude_option
&& check_exclude (current_file_name
)))
88 if (current_header
->header
.typeflag
== GNUTYPE_VOLHDR
89 || current_header
->header
.typeflag
== GNUTYPE_MULTIVOL
90 || current_header
->header
.typeflag
== GNUTYPE_NAMES
)
95 if (show_omitted_dirs_option
96 && current_header
->header
.typeflag
== DIRTYPE
)
97 WARN ((0, 0, _("Omitting %s"), current_file_name
));
99 /* Skip past it in the archive. */
101 if (current_header
->oldgnu_header
.isextended
)
103 save_typeflag
= current_header
->header
.typeflag
;
104 set_next_block_after (current_header
);
112 exhdr
= find_next_block ();
113 if (!exhdr
->sparse_header
.isextended
)
115 set_next_block_after (exhdr
);
119 set_next_block_after (exhdr
);
121 skip_extended_headers ();
124 /* Skip to the next header on the archive. */
126 if (save_typeflag
!= DIRTYPE
)
127 skip_file (current_stat
.st_size
);
134 case HEADER_ZERO_BLOCK
:
135 if (block_number_option
)
137 char buf
[UINTMAX_STRSIZE_BOUND
];
138 fprintf (stdlis
, _("block %s: ** Block of NULs **\n"),
139 STRINGIFY_BIGINT (current_block_ordinal (), buf
));
142 set_next_block_after (current_header
);
143 status
= prev_status
;
144 if (ignore_zeros_option
)
148 case HEADER_END_OF_FILE
:
149 if (block_number_option
)
151 char buf
[UINTMAX_STRSIZE_BOUND
];
152 fprintf (stdlis
, _("block %s: ** End of File **\n"),
153 STRINGIFY_BIGINT (current_block_ordinal (), buf
));
158 /* If the previous header was good, tell them that we are
159 skipping bad ones. */
160 set_next_block_after (current_header
);
163 case HEADER_STILL_UNREAD
:
164 WARN ((0, 0, _("Hmm, this doesn't look like a tar archive")));
167 case HEADER_ZERO_BLOCK
:
169 WARN ((0, 0, _("Skipping to next file header")));
172 case HEADER_END_OF_FILE
:
174 /* We are in the middle of a cascade of errors. */
183 apply_delayed_set_stat ();
185 names_notfound (); /* print names not found */
188 /*---------------------------------------------.
189 | Print a header block, based on tar options. |
190 `---------------------------------------------*/
195 int isextended
= 0; /* to remember if current_header is extended */
197 /* Print the header block. */
201 if (verbose_option
> 1)
202 decode_header (current_header
, ¤t_stat
, ¤t_format
, 0);
206 if (incremental_option
&& current_header
->header
.typeflag
== GNUTYPE_DUMPDIR
)
209 size_t written
, check
;
210 union block
*data_block
;
212 set_next_block_after (current_header
);
213 if (multi_volume_option
)
215 assign_string (&save_name
, current_file_name
);
216 save_totsize
= current_stat
.st_size
;
218 for (size
= current_stat
.st_size
; size
> 0; size
-= written
)
220 if (multi_volume_option
)
221 save_sizeleft
= size
;
222 data_block
= find_next_block ();
225 ERROR ((0, 0, _("EOF in archive file")));
226 break; /* FIXME: What happens, then? */
228 written
= available_space_after (data_block
);
231 errno
= 0; /* FIXME: errno should be read-only */
232 check
= fwrite (data_block
->buffer
, sizeof (char), written
, stdlis
);
233 set_next_block_after ((union block
*)
234 (data_block
->buffer
+ written
- 1));
235 if (check
!= written
)
237 ERROR ((0, errno
, _("Only wrote %lu of %lu bytes to file %s"),
238 (unsigned long) check
,
239 (unsigned long) written
, current_file_name
));
240 skip_file (size
- written
);
244 if (multi_volume_option
)
245 assign_string (&save_name
, NULL
);
246 fputc ('\n', stdlis
);
252 /* Check to see if we have an extended header to skip over also. */
254 if (current_header
->oldgnu_header
.isextended
)
257 /* Skip past the header in the archive. */
259 set_next_block_after (current_header
);
261 /* If we needed to skip any extended headers, do so now, by reading
262 extended headers and skipping past them in the archive. */
271 exhdr
= find_next_block ();
273 if (!exhdr
->sparse_header
.isextended
)
275 set_next_block_after (exhdr
);
278 set_next_block_after (exhdr
);
281 skip_extended_headers ();
284 if (multi_volume_option
)
285 assign_string (&save_name
, current_file_name
);
287 /* Skip to the next header on the archive. */
289 skip_file (current_stat
.st_size
);
291 if (multi_volume_option
)
292 assign_string (&save_name
, NULL
);
295 /*-----------------------------------------------------------------------.
296 | Read a block that's supposed to be a header block. Return its address |
297 | in "current_header", and if it is good, the file's size in |
298 | current_stat.st_size. |
300 | Return 1 for success, 0 if the checksum is bad, EOF on eof, 2 for a |
301 | block full of zeros (EOF marker). |
303 | You must always set_next_block_after(current_header) to skip past the |
304 | header which this routine reads. |
305 `-----------------------------------------------------------------------*/
307 /* The standard BSD tar sources create the checksum by adding up the
308 bytes in the header as type char. I think the type char was unsigned
309 on the PDP-11, but it's signed on the Next and Sun. It looks like the
310 sources to BSD tar were never changed to compute the checksum
311 currectly, so both the Sun and Next add the bytes of the header as
312 signed chars. This doesn't cause a problem until you get a file with
313 a name containing characters with the high bit set. So read_header
314 computes two checksums -- signed and unsigned. */
316 /* FIXME: The signed checksum computation is broken on machines where char's
317 are unsigned. It's uneasy to handle all cases correctly... */
323 long unsigned_sum
; /* the POSIX one :-) */
324 long signed_sum
; /* the Sun one :-( */
326 uintmax_t parsed_sum
;
331 union block
*data_block
;
332 size_t size
, written
;
333 static char *next_long_name
, *next_long_link
;
337 header
= find_next_block ();
338 current_header
= header
;
340 return HEADER_END_OF_FILE
;
342 parsed_sum
= from_oct (header
->header
.chksum
,
343 sizeof header
->header
.chksum
,
344 (char *) 0, TYPE_MAXIMUM (long));
345 if (parsed_sum
== (uintmax_t) -1)
346 return HEADER_FAILURE
;
348 recorded_sum
= parsed_sum
;
352 for (i
= sizeof (*header
); i
-- != 0;)
354 /* We can't use unsigned char here because of old compilers,
357 unsigned_sum
+= 0xFF & *p
;
361 /* Adjust checksum to count the "chksum" field as blanks. */
363 for (i
= sizeof (header
->header
.chksum
); i
-- != 0;)
365 unsigned_sum
-= 0xFF & header
->header
.chksum
[i
];
366 signed_sum
-= header
->header
.chksum
[i
];
368 unsigned_sum
+= ' ' * sizeof header
->header
.chksum
;
369 signed_sum
+= ' ' * sizeof header
->header
.chksum
;
371 if (unsigned_sum
== sizeof header
->header
.chksum
* ' ')
373 /* This is a zeroed block...whole block is 0's except for the
374 blanks we faked for the checksum field. */
376 return HEADER_ZERO_BLOCK
;
379 if (unsigned_sum
!= recorded_sum
&& signed_sum
!= recorded_sum
)
380 return HEADER_FAILURE
;
382 /* Good block. Decode file size and return. */
384 if (header
->header
.typeflag
== LNKTYPE
)
385 current_stat
.st_size
= 0; /* links 0 size on tape */
387 current_stat
.st_size
= OFF_FROM_OCT (header
->header
.size
);
389 header
->header
.name
[NAME_FIELD_SIZE
- 1] = '\0';
390 if (header
->header
.typeflag
== GNUTYPE_LONGNAME
391 || header
->header
.typeflag
== GNUTYPE_LONGLINK
)
393 longp
= ((header
->header
.typeflag
== GNUTYPE_LONGNAME
)
397 set_next_block_after (header
);
400 size
= current_stat
.st_size
;
401 if (size
!= current_stat
.st_size
)
402 FATAL_ERROR ((0, 0, _("Memory exhausted")));
403 bp
= *longp
= (char *) xmalloc (size
);
405 for (; size
> 0; size
-= written
)
407 data_block
= find_next_block ();
408 if (data_block
== NULL
)
410 ERROR ((0, 0, _("Unexpected EOF on archive file")));
413 written
= available_space_after (data_block
);
417 memcpy (bp
, data_block
->buffer
, written
);
419 set_next_block_after ((union block
*)
420 (data_block
->buffer
+ written
- 1));
428 char *name
= next_long_name
;
429 struct posix_header
*h
= ¤t_header
->header
;
430 char namebuf
[sizeof h
->prefix
+ 1 + sizeof h
->name
+ 1];
434 /* Accept file names as specified by POSIX.1-1996
439 memcpy (np
, h
->prefix
, sizeof h
->prefix
);
440 np
[sizeof h
->prefix
] = '\0';
444 memcpy (np
, h
->name
, sizeof h
->name
);
445 np
[sizeof h
->name
] = '\0';
449 assign_string (¤t_file_name
, name
);
450 assign_string (¤t_link_name
,
451 (next_long_link
? next_long_link
452 : current_header
->header
.linkname
));
453 next_long_link
= next_long_name
= 0;
454 return HEADER_SUCCESS
;
459 /*-------------------------------------------------------------------------.
460 | Decode things from a file HEADER block into STAT_INFO, also setting |
461 | *FORMAT_POINTER depending on the header block format. If DO_USER_GROUP, |
462 | decode the user/group information (this is useful for extraction, but |
463 | waste time when merely listing). |
465 | read_header() has already decoded the checksum and length, so we don't. |
467 | This routine should *not* be called twice for the same block, since the |
468 | two calls might use different DO_USER_GROUP values and thus might end up |
469 | with different uid/gid for the two calls. If anybody wants the uid/gid |
470 | they should decode it first, and other callers should decode it without |
471 | uid/gid before calling a routine, e.g. print_header, that assumes |
473 `-------------------------------------------------------------------------*/
476 decode_header (union block
*header
, struct stat
*stat_info
,
477 enum archive_format
*format_pointer
, int do_user_group
)
479 enum archive_format format
;
481 if (strcmp (header
->header
.magic
, TMAGIC
) == 0)
482 format
= POSIX_FORMAT
;
483 else if (strcmp (header
->header
.magic
, OLDGNU_MAGIC
) == 0)
484 format
= OLDGNU_FORMAT
;
487 *format_pointer
= format
;
489 stat_info
->st_mode
= MODE_FROM_OCT (header
->header
.mode
);
490 stat_info
->st_mode
&= 07777;
491 stat_info
->st_mtime
= TIME_FROM_OCT (header
->header
.mtime
);
493 if (format
== OLDGNU_FORMAT
&& incremental_option
)
495 stat_info
->st_atime
= TIME_FROM_OCT (header
->oldgnu_header
.atime
);
496 stat_info
->st_ctime
= TIME_FROM_OCT (header
->oldgnu_header
.ctime
);
499 if (format
== V7_FORMAT
)
501 stat_info
->st_uid
= UID_FROM_OCT (header
->header
.uid
);
502 stat_info
->st_gid
= GID_FROM_OCT (header
->header
.gid
);
503 stat_info
->st_rdev
= 0;
509 /* FIXME: Decide if this should somewhat depend on -p. */
511 if (numeric_owner_option
512 || !*header
->header
.uname
513 || !uname_to_uid (header
->header
.uname
, &stat_info
->st_uid
))
514 stat_info
->st_uid
= UID_FROM_OCT (header
->header
.uid
);
516 if (numeric_owner_option
517 || !*header
->header
.gname
518 || !gname_to_gid (header
->header
.gname
, &stat_info
->st_gid
))
519 stat_info
->st_gid
= GID_FROM_OCT (header
->header
.gid
);
521 switch (header
->header
.typeflag
)
526 = makedev (MAJOR_FROM_OCT (header
->header
.devmajor
),
527 MINOR_FROM_OCT (header
->header
.devminor
));
534 = makedev (MAJOR_FROM_OCT (header
->header
.devmajor
),
535 MINOR_FROM_OCT (header
->header
.devminor
));
540 stat_info
->st_rdev
= 0;
545 /*------------------------------------------------------------------------.
546 | Quick and dirty octal conversion. Result is -1 if the field is invalid |
547 | (all blank, or nonoctal). |
548 `------------------------------------------------------------------------*/
551 from_oct (const char *where0
, size_t digs0
, const char *type
, uintmax_t maxval
)
554 const char *where
= where0
;
562 ERROR ((0, 0, _("Blanks in header where octal %s value expected"),
566 if (!ISSPACE (*where
))
573 while (digs
!= 0 && ISODIGIT (*where
))
575 /* Scan til nonoctal. */
577 if (value
<< 3 >> 3 != value
)
579 value
= (value
<< 3) | (*where
++ - '0');
583 if (digs
!= 0 && *where
&& !ISSPACE (*where
))
587 char buf
[1000]; /* Big enough to represent any header. */
588 static struct quoting_options
*o
;
592 o
= clone_quoting_options ((struct quoting_options
*) 0);
593 set_quoting_style (o
, escape_quoting_style
);
596 quotearg_buffer (buf
, sizeof buf
, where0
, digs0
, o
);
598 _("Header contains \"%.*s\" where octal %s value expected"),
599 (int) sizeof buf
, buf
, type
));
610 ERROR ((0, 0, _("Octal value `%.*s' is out of range for %s"),
611 (int) digs0
, where0
, type
));
615 gid_from_oct (const char *p
, size_t s
)
617 return from_oct (p
, s
, "gid_t", (uintmax_t) TYPE_MAXIMUM (gid_t
));
620 major_from_oct (const char *p
, size_t s
)
622 return from_oct (p
, s
, "major_t", (uintmax_t) TYPE_MAXIMUM (major_t
));
625 minor_from_oct (const char *p
, size_t s
)
627 return from_oct (p
, s
, "minor_t", (uintmax_t) TYPE_MAXIMUM (minor_t
));
630 mode_from_oct (const char *p
, size_t s
)
632 return from_oct (p
, s
, "mode_t", (uintmax_t) TYPE_MAXIMUM (mode_t
));
635 off_from_oct (const char *p
, size_t s
)
637 return from_oct (p
, s
, "off_t", (uintmax_t) TYPE_MAXIMUM (off_t
));
640 size_from_oct (const char *p
, size_t s
)
642 return from_oct (p
, s
, "size_t", (uintmax_t) TYPE_MAXIMUM (size_t));
645 time_from_oct (const char *p
, size_t s
)
647 return from_oct (p
, s
, "time_t", (uintmax_t) TYPE_MAXIMUM (time_t));
650 uid_from_oct (const char *p
, size_t s
)
652 return from_oct (p
, s
, "uid_t", (uintmax_t) TYPE_MAXIMUM (uid_t
));
655 uintmax_from_oct (const char *p
, size_t s
)
657 return from_oct (p
, s
, "uintmax_t", TYPE_MAXIMUM (uintmax_t));
662 /*----------------------------------------------------------------------.
663 | Format O as a null-terminated decimal string into BUF _backwards_; |
664 | return pointer to start of result. |
665 `----------------------------------------------------------------------*/
667 stringify_uintmax_t_backwards (uintmax_t o
, char *buf
)
671 *--buf
= '0' + (int) (o
% 10);
672 while ((o
/= 10) != 0);
678 /*-------------------------------------------.
679 | Return the time formatted along ISO 8601. |
680 `-------------------------------------------*/
682 /* Also, see http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html. */
685 isotime (const time_t *time
)
687 static char buffer
[21];
690 tm
= localtime (time
);
691 sprintf (buffer
, "%4d-%02d-%02d %02d:%02d:%02d\n",
692 tm
->tm_year
+ 1900, tm
->tm_mon
+ 1, tm
->tm_mday
,
693 tm
->tm_hour
, tm
->tm_min
, tm
->tm_sec
);
697 #endif /* not USE_OLD_CTIME */
699 /*-------------------------------------------------------------------------.
700 | Decode MODE from its binary form in a stat structure, and encode it into |
701 | a 9 characters string STRING, terminated with a NUL. |
702 `-------------------------------------------------------------------------*/
705 decode_mode (mode_t mode
, char *string
)
708 const char *rwx
= "rwxrwxrwx";
710 for (mask
= 0400; mask
!= 0; mask
>>= 1)
720 string
[-7] = string
[-7] == 'x' ? 's' : 'S';
722 string
[-4] = string
[-4] == 'x' ? 's' : 'S';
724 string
[-1] = string
[-1] == 'x' ? 't' : 'T';
729 /*-------------------------------------------------------------------------.
730 | Actually print it. |
732 | Plain and fancy file header block logging. Non-verbose just prints the |
733 | name, e.g. for "tar t" or "tar x". This should just contain file names, |
734 | so it can be fed back into tar with xargs or the "-T" option. The |
735 | verbose option can give a bunch of info, one line per file. I doubt |
736 | anybody tries to parse its format, or if they do, they shouldn't. Unix |
737 | tar is pretty random here anyway. |
738 `-------------------------------------------------------------------------*/
740 /* FIXME: Note that print_header uses the globals HEAD, HSTAT, and
741 HEAD_STANDARD, which must be set up in advance. Not very clean... */
743 /* UGSWIDTH starts with 18, so with user and group names <= 8 chars, the
744 columns never shift during the listing. */
746 static int ugswidth
= UGSWIDTH
; /* maximum width encountered so far */
748 /* DATEWIDTH is the number of columns taken by the date and time fields. */
750 # define DATEWIDTH 19
752 # define DATEWIDTH 18
760 char uform
[11], gform
[11]; /* these hold formatted ints */
762 char size
[2 * UINTMAX_STRSIZE_BOUND
];
763 /* holds formatted size or major,minor */
764 char uintbuf
[UINTMAX_STRSIZE_BOUND
];
765 time_t longie
; /* to make ctime() call portable */
769 if (block_number_option
)
771 char buf
[UINTMAX_STRSIZE_BOUND
];
772 fprintf (stdlis
, _("block %s: "),
773 STRINGIFY_BIGINT (current_block_ordinal (), buf
));
776 if (verbose_option
<= 1)
778 /* Just the fax, mam. */
780 char *quoted_name
= quote_copy_string (current_file_name
);
784 fprintf (stdlis
, "%s\n", quoted_name
);
788 fprintf (stdlis
, "%s\n", current_file_name
);
792 /* File type and modes. */
795 switch (current_header
->header
.typeflag
)
801 case GNUTYPE_MULTIVOL
:
809 case GNUTYPE_LONGNAME
:
810 case GNUTYPE_LONGLINK
:
811 ERROR ((0, 0, _("Visible longname error")));
819 if (current_file_name
[strlen (current_file_name
) - 1] == '/')
822 case GNUTYPE_DUMPDIR
:
845 decode_mode (current_stat
.st_mode
, modes
+ 1);
849 longie
= current_stat
.st_mtime
;
851 timestamp
= ctime (&longie
);
852 timestamp
[16] = '\0';
853 timestamp
[24] = '\0';
855 timestamp
= isotime (&longie
);
856 timestamp
[16] = '\0';
859 /* User and group names. */
861 if (*current_header
->header
.uname
&& current_format
!= V7_FORMAT
)
862 user
= current_header
->header
.uname
;
864 user
= STRINGIFY_BIGINT (UINTMAX_FROM_OCT (current_header
->header
.uid
),
867 if (*current_header
->header
.gname
&& current_format
!= V7_FORMAT
)
868 group
= current_header
->header
.gname
;
870 group
= STRINGIFY_BIGINT (UINTMAX_FROM_OCT
871 (current_header
->header
.gid
),
874 /* Format the file size or major/minor device numbers. */
876 switch (current_header
->header
.typeflag
)
878 #if defined(S_IFBLK) || defined(S_IFCHR)
881 sprintf (size
, "%lu,%lu",
882 (unsigned long) major (current_stat
.st_rdev
),
883 (unsigned long) minor (current_stat
.st_rdev
));
889 (UINTMAX_FROM_OCT (current_header
->oldgnu_header
.realsize
),
893 strcpy (size
, STRINGIFY_BIGINT (current_stat
.st_size
, uintbuf
));
897 /* Figure out padding and print the whole line. */
899 pad
= strlen (user
) + strlen (group
) + strlen (size
) + 1;
904 fprintf (stdlis
, "%s %s/%s %*s%s %s %s",
905 modes
, user
, group
, ugswidth
- pad
, "",
906 size
, timestamp
+ 4, timestamp
+ 20);
908 fprintf (stdlis
, "%s %s/%s %*s%s %s",
909 modes
, user
, group
, ugswidth
- pad
, "", size
, timestamp
);
912 name
= quote_copy_string (current_file_name
);
915 fprintf (stdlis
, " %s", name
);
919 fprintf (stdlis
, " %s", current_file_name
);
921 switch (current_header
->header
.typeflag
)
924 name
= quote_copy_string (current_link_name
);
927 fprintf (stdlis
, " -> %s\n", name
);
931 fprintf (stdlis
, " -> %s\n", current_link_name
);
935 name
= quote_copy_string (current_link_name
);
938 fprintf (stdlis
, _(" link to %s\n"), name
);
942 fprintf (stdlis
, _(" link to %s\n"), current_link_name
);
946 fprintf (stdlis
, _(" unknown file type `%c'\n"),
947 current_header
->header
.typeflag
);
958 case GNUTYPE_DUMPDIR
:
963 fprintf (stdlis
, _("--Volume Header--\n"));
966 case GNUTYPE_MULTIVOL
:
969 (UINTMAX_FROM_OCT (current_header
->oldgnu_header
.offset
),
971 fprintf (stdlis
, _("--Continued at byte %s--\n"), size
);
975 fprintf (stdlis
, _("--Mangled file names--\n"));
982 /*--------------------------------------------------------------.
983 | Print a similar line when we make a directory automatically. |
984 `--------------------------------------------------------------*/
987 print_for_mkdir (char *pathname
, int length
, mode_t mode
)
992 if (verbose_option
> 1)
994 /* File type and modes. */
997 decode_mode (mode
, modes
+ 1);
999 if (block_number_option
)
1001 char buf
[UINTMAX_STRSIZE_BOUND
];
1002 fprintf (stdlis
, _("block %s: "),
1003 STRINGIFY_BIGINT (current_block_ordinal (), buf
));
1005 name
= quote_copy_string (pathname
);
1008 fprintf (stdlis
, "%s %*s %.*s\n", modes
, ugswidth
+ DATEWIDTH
,
1009 _("Creating directory:"), length
, name
);
1013 fprintf (stdlis
, "%s %*s %.*s\n", modes
, ugswidth
+ DATEWIDTH
,
1014 _("Creating directory:"), length
, pathname
);
1018 /*--------------------------------------------------------.
1019 | Skip over SIZE bytes of data in blocks in the archive. |
1020 `--------------------------------------------------------*/
1023 skip_file (off_t size
)
1027 if (multi_volume_option
)
1029 save_totsize
= size
;
1030 save_sizeleft
= size
;
1035 x
= find_next_block ();
1037 FATAL_ERROR ((0, 0, _("Unexpected EOF on archive file")));
1039 set_next_block_after (x
);
1041 if (multi_volume_option
)
1042 save_sizeleft
-= BLOCKSIZE
;
1051 skip_extended_headers (void)
1057 exhdr
= find_next_block ();
1058 if (!exhdr
->sparse_header
.isextended
)
1060 set_next_block_after (exhdr
);
1063 set_next_block_after (exhdr
);