reformatting controlchan

Marco d'Itri md at Linux.IT
Thu Jan 25 01:38:14 UTC 2001

On Jan 25, Russ Allbery <rra at> wrote:

 >> - ugly code like:
 >>                         open(TEMPFILE, $tempfile) or die;
 >>                         open(NEWSGROUPS, ">$inn::newsgroups") or die;
 >>                         print NEWSGROUPS $_ while <TEMPFILE>;
 >>                         close TEMPFILE;
 >>                         close NEWSGROUPS;
 >>   (it does not change the permissions of newsgroups, but is this a side
 >>    effect or a feature to be preserved?)
 >It really should shlock newsgroups and then append to it, shouldn't it?
No, the file has to be rewritten (using a tempfile).
BTW, thinking again about it, this code (which is the translation of
"cat ${TEMP} >${NEWSGROUPS}" in the original script) creates a time
window where the file is incomplete.
I'll consider this code to be a bug and do an atomic rename instead.


More information about the inn-workers mailing list