"-t": Note that file is compressed if compressed
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 3s
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 3s
This commit is contained in:
parent
2364f53649
commit
0299129ea6
1 changed files with 7 additions and 1 deletions
|
@ -289,6 +289,7 @@ int simple_archiver_print_archive_info(FILE *in_f) {
|
||||||
uint16_t u16;
|
uint16_t u16;
|
||||||
uint32_t u32;
|
uint32_t u32;
|
||||||
uint64_t u64;
|
uint64_t u64;
|
||||||
|
int is_compressed = 0;
|
||||||
|
|
||||||
if (fread(buf, 1, 18, in_f) != 18) {
|
if (fread(buf, 1, 18, in_f) != 18) {
|
||||||
return SDAS_INVALID_FILE;
|
return SDAS_INVALID_FILE;
|
||||||
|
@ -305,6 +306,7 @@ int simple_archiver_print_archive_info(FILE *in_f) {
|
||||||
|
|
||||||
if ((buf[0] & 1) != 0) {
|
if ((buf[0] & 1) != 0) {
|
||||||
fprintf(stderr, "De/compressor flag is set.\n");
|
fprintf(stderr, "De/compressor flag is set.\n");
|
||||||
|
is_compressed = 1;
|
||||||
|
|
||||||
// Read compressor data.
|
// Read compressor data.
|
||||||
if (fread(&u16, 2, 1, in_f) != 1) {
|
if (fread(&u16, 2, 1, in_f) != 1) {
|
||||||
|
@ -397,7 +399,11 @@ int simple_archiver_print_archive_info(FILE *in_f) {
|
||||||
return SDAS_INVALID_FILE;
|
return SDAS_INVALID_FILE;
|
||||||
}
|
}
|
||||||
simple_archiver_helper_64_bit_be(&u64);
|
simple_archiver_helper_64_bit_be(&u64);
|
||||||
fprintf(stderr, " File size: %lu\n", u64);
|
if (is_compressed) {
|
||||||
|
fprintf(stderr, " File size (compressed): %lu\n", u64);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, " File size: %lu\n", u64);
|
||||||
|
}
|
||||||
while (u64 > 0) {
|
while (u64 > 0) {
|
||||||
if (u64 > 1024) {
|
if (u64 > 1024) {
|
||||||
if (fread(buf, 1, 1024, in_f) != 1024) {
|
if (fread(buf, 1, 1024, in_f) != 1024) {
|
||||||
|
|
Loading…
Reference in a new issue