simon-git: reservoir (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Thu Mar 19 12:14:44 GMT 2020
TL;DR:
0972663 Support -a to append to an existing output file.
Repository: https://git.tartarus.org/simon/reservoir.git
On the web: https://git.tartarus.org/?p=simon/reservoir.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2020-03-19 12:14:44
commit 0972663e71196454e81a1b7833501e0fb92bc074
web diff https://git.tartarus.org/?p=simon/reservoir.git;a=commitdiff;h=0972663e71196454e81a1b7833501e0fb92bc074;hp=0aff497a276baa7a17260b485d3e2aa25d785b4e
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Mar 19 12:14:40 2020 +0000
Support -a to append to an existing output file.
Works just like -O / -o, but opens the output file with ">>" instead
of ">" (in Perl terms).
In this mode, it doesn't matter very much whether we check for an
empty data buffer: it makes no difference to the output file if we
append an empty buffer to it or don't append anything to it. But I
think it's slightly nicer in that situation to not even bother opening
it for writing; that will preserve its existing timestamp, so that if
it's a source file in a Makefile, it won't cause unnecessary rebuilds.
(I suppose an alternative point of view would be that it also doesn't
diagnose the file being read-only, which you might prefer to find out
this time rather than waiting until later when there _is_ data to
write. Anyone who wants this 'unconditionally attempt the append'
behaviour is welcome to send a patch adding -A alongside -a!
reservoir | 6 ++++--
reservoir.but | 13 +++++++++++++
2 files changed, 17 insertions(+), 2 deletions(-)
More information about the tartarus-commits
mailing list