[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fflush & close behavior not well-defined

From: Neil R. Ormos
Subject: Re: fflush & close behavior not well-defined
Date: Mon, 14 Sep 2020 11:03:22 -0500 (CDT)

Andrew J. Schorr wrote:
> Manuel Collado wrote:

>> Another possibility would be to add two
>> specific close() wrappers, say

>> close_file(file)
>> close_pipe(pipe, how)

>> To be used if it is necessary to disambiguate.

> And you'd also need close_coprocess(pipe,
> how). In my view, it's simpler to enhance the
> existing close and fflush functions, but I grant
> that these problems are very unlikely to occur
> in real life.  It's just sloppiness in the awk
> POSIX spec that has failed to disambiguate.

Is there a way to expose a handle or other
unambiguous ID corresponding to the most recent
operation on a file, pipe, or coprocess?

Then, a user who needs a non-ambiguous call to
close() or fflush() could pass the handle instead
of, or in addition to, the current filename

reply via email to

[Prev in Thread] Current Thread [Next in Thread]