}
}
- stat_info->archive_file_size = stat_info->stat.st_size;
xheader_decode (stat_info);
if (sparse_member_p (stat_info))
size_t sparse_map_size; /* Size of the sparse map */
struct sp_array *sparse_map;
+ off_t real_size; /* The real size of sparse file */
+ int real_size_set; /* True when GNU.sparse.realsize is set in
+ archived file */
+
size_t xattr_map_size; /* Size of the xattr map */
struct xattr_array *xattr_map;
continue;
}
run_override_list (keyword_override_list, st);
+
+ /* The archived (effective) file size is always set directly in tar header
+ field, possibly overridden by "size" extended header - in both cases,
+ result is now decoded in st->stat.st_size */
+ st->archive_file_size = st->stat.st_size;
+
+ /* The real file size (given by stat()) may be redefined for sparse
+ files in "GNU.sparse.realsize" extended header */
+ if (st->real_size_set)
+ st->stat.st_size = st->real_size;
}
static void
{
uintmax_t u;
if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), keyword))
- st->stat.st_size = u;
+ {
+ st->real_size_set = 1;
+ st->real_size = u;
+ }
}
static void