fopen ( ..., "a" ) --- how does the "a" work?

Wm E Davidsen Jr davidsen at crdos1.crd.ge.COM
Fri Dec 8 05:45:21 AEST 1989


  In retrospect I think that one more key letter would have been useful
in pANS. The use of "a" to mean 'always append, never rewrite' is a
useful one, but often "a" is used when what is meant is to 'open the
existing file if there is one, otherwise create one.'

  If "a" really means append only, then the second use requires:
    open for "r"
    if that fails open for "w+"

  This is not a big deal, but either another open type in addition to
{rwa} could have been provided, or another modifier in addition to {+b}
would suffice. Something for the next committee to consider, I suspect.
-- 
bill davidsen	(davidsen at crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon



More information about the Comp.unix.questions mailing list