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 /* These hold formatted ints. */
761 char uform
[UINTMAX_STRSIZE_BOUND
], gform
[UINTMAX_STRSIZE_BOUND
];
763 char size
[2 * UINTMAX_STRSIZE_BOUND
];
764 /* holds formatted size or major,minor */
765 char uintbuf
[UINTMAX_STRSIZE_BOUND
];
766 time_t longie
; /* to make ctime() call portable */
770 if (block_number_option
)
772 char buf
[UINTMAX_STRSIZE_BOUND
];
773 fprintf (stdlis
, _("block %s: "),
774 STRINGIFY_BIGINT (current_block_ordinal (), buf
));
777 if (verbose_option
<= 1)
779 /* Just the fax, mam. */
781 char *quoted_name
= quote_copy_string (current_file_name
);
785 fprintf (stdlis
, "%s\n", quoted_name
);
789 fprintf (stdlis
, "%s\n", current_file_name
);
793 /* File type and modes. */
796 switch (current_header
->header
.typeflag
)
802 case GNUTYPE_MULTIVOL
:
810 case GNUTYPE_LONGNAME
:
811 case GNUTYPE_LONGLINK
:
812 ERROR ((0, 0, _("Visible longname error")));
820 if (current_file_name
[strlen (current_file_name
) - 1] == '/')
823 case GNUTYPE_DUMPDIR
:
846 decode_mode (current_stat
.st_mode
, modes
+ 1);
850 longie
= current_stat
.st_mtime
;
852 timestamp
= ctime (&longie
);
853 timestamp
[16] = '\0';
854 timestamp
[24] = '\0';
856 timestamp
= isotime (&longie
);
857 timestamp
[16] = '\0';
860 /* User and group names. */
862 if (*current_header
->header
.uname
&& current_format
!= V7_FORMAT
)
863 user
= current_header
->header
.uname
;
865 user
= STRINGIFY_BIGINT (UINTMAX_FROM_OCT (current_header
->header
.uid
),
868 if (*current_header
->header
.gname
&& current_format
!= V7_FORMAT
)
869 group
= current_header
->header
.gname
;
871 group
= STRINGIFY_BIGINT (UINTMAX_FROM_OCT
872 (current_header
->header
.gid
),
875 /* Format the file size or major/minor device numbers. */
877 switch (current_header
->header
.typeflag
)
879 #if defined(S_IFBLK) || defined(S_IFCHR)
882 sprintf (size
, "%lu,%lu",
883 (unsigned long) major (current_stat
.st_rdev
),
884 (unsigned long) minor (current_stat
.st_rdev
));
890 (UINTMAX_FROM_OCT (current_header
->oldgnu_header
.realsize
),
894 strcpy (size
, STRINGIFY_BIGINT (current_stat
.st_size
, uintbuf
));
898 /* Figure out padding and print the whole line. */
900 pad
= strlen (user
) + strlen (group
) + strlen (size
) + 1;
905 fprintf (stdlis
, "%s %s/%s %*s%s %s %s",
906 modes
, user
, group
, ugswidth
- pad
, "",
907 size
, timestamp
+ 4, timestamp
+ 20);
909 fprintf (stdlis
, "%s %s/%s %*s%s %s",
910 modes
, user
, group
, ugswidth
- pad
, "", size
, timestamp
);
913 name
= quote_copy_string (current_file_name
);
916 fprintf (stdlis
, " %s", name
);
920 fprintf (stdlis
, " %s", current_file_name
);
922 switch (current_header
->header
.typeflag
)
925 name
= quote_copy_string (current_link_name
);
928 fprintf (stdlis
, " -> %s\n", name
);
932 fprintf (stdlis
, " -> %s\n", current_link_name
);
936 name
= quote_copy_string (current_link_name
);
939 fprintf (stdlis
, _(" link to %s\n"), name
);
943 fprintf (stdlis
, _(" link to %s\n"), current_link_name
);
947 fprintf (stdlis
, _(" unknown file type `%c'\n"),
948 current_header
->header
.typeflag
);
959 case GNUTYPE_DUMPDIR
:
964 fprintf (stdlis
, _("--Volume Header--\n"));
967 case GNUTYPE_MULTIVOL
:
970 (UINTMAX_FROM_OCT (current_header
->oldgnu_header
.offset
),
972 fprintf (stdlis
, _("--Continued at byte %s--\n"), size
);
976 fprintf (stdlis
, _("--Mangled file names--\n"));
983 /*--------------------------------------------------------------.
984 | Print a similar line when we make a directory automatically. |
985 `--------------------------------------------------------------*/
988 print_for_mkdir (char *pathname
, int length
, mode_t mode
)
993 if (verbose_option
> 1)
995 /* File type and modes. */
998 decode_mode (mode
, modes
+ 1);
1000 if (block_number_option
)
1002 char buf
[UINTMAX_STRSIZE_BOUND
];
1003 fprintf (stdlis
, _("block %s: "),
1004 STRINGIFY_BIGINT (current_block_ordinal (), buf
));
1006 name
= quote_copy_string (pathname
);
1009 fprintf (stdlis
, "%s %*s %.*s\n", modes
, ugswidth
+ DATEWIDTH
,
1010 _("Creating directory:"), length
, name
);
1014 fprintf (stdlis
, "%s %*s %.*s\n", modes
, ugswidth
+ DATEWIDTH
,
1015 _("Creating directory:"), length
, pathname
);
1019 /*--------------------------------------------------------.
1020 | Skip over SIZE bytes of data in blocks in the archive. |
1021 `--------------------------------------------------------*/
1024 skip_file (off_t size
)
1028 if (multi_volume_option
)
1030 save_totsize
= size
;
1031 save_sizeleft
= size
;
1036 x
= find_next_block ();
1038 FATAL_ERROR ((0, 0, _("Unexpected EOF on archive file")));
1040 set_next_block_after (x
);
1042 if (multi_volume_option
)
1043 save_sizeleft
-= BLOCKSIZE
;
1052 skip_extended_headers (void)
1058 exhdr
= find_next_block ();
1059 if (!exhdr
->sparse_header
.isextended
)
1061 set_next_block_after (exhdr
);
1064 set_next_block_after (exhdr
);