aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-12-07 02:29:59 -0500
committerB. Watson <urchlay@slackware.uk>2025-12-07 02:29:59 -0500
commit2718ebef0c3a1dcaab74b567ba5726a9fa20fcdb (patch)
tree77813a70af69b85969df346c5c4466d00fec7050
parent32b66419b8137e18ec949093d507bf29c8528d7d (diff)
downloadalftools-2718ebef0c3a1dcaab74b567ba5726a9fa20fcdb.tar.gz
alf -vv: say "Created" if trying to append to a file that doesn't exist.
-rw-r--r--src/alf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/alf.c b/src/alf.c
index 4144d65..12f1608 100644
--- a/src/alf.c
+++ b/src/alf.c
@@ -236,6 +236,9 @@ void crunch_file(const char *filename_arg) {
perror(out_filename);
exit(1);
}
+ /* so -vv will correctly say "Created" if trying to append to
+ a non-existent file. */
+ if(ftell(out_file) == 0) opt_append = 0;
}
if(fwrite(output_buf, 1, output_len, out_file) < 0) {