[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 13:09:09 -0500 (CDT) |
Andrew J. Schorr wrote:
> Neil R. Ormos wrote:
>> Is there a way to expose a handle or other
>> unambiguous ID corresponding to the most recent
>> operation on a file, pipe, or coprocess?
> Anything is possible. Behind the scenes, each
> open file/pipe/coprocess is represented by a
> structure, so of course the address of the
> structure is a unique identifier. Or one could
> assign an arbitrary identifier. That's not
> hard. Are you suggesting to stick this value
> somewhere in PROCINFO or some other global
> variable every time an I/O occurs? That seems a
> bit heavyweight for something nobody actually
> cares about.
That is what I was suggesting. I imagined that
once the file had been opened, all that would be
needed to update the global variable, for each
I/O, would be to copy a pointer, which operation I
further imagined to be so cheap, compared to
actually launching the I/O, as to be "in the
noise".
Since you know the internals and I don't, I defer.
>> 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
>> argument?
> I don't see why this is better than enhancing
> the close & fflush functions to give them the
> info they need to find the correct file, but
> maybe if you flesh out your idea with an
> example, I'll understand better.
I'm not sure it's /better/. It just seems
/cleaner/ to let the user account for and supply a
single unambiguous identifier, than to require the
user to supply both the name and type of the
something that is to be close()-d or fflush()-ed,
and then for close() or fflush() to hunt around
for a match.
Again, I recognize that you know the internals and
I don't.
And that both you and Arnold see this as something
nobody actually cares about.
- fflush & close behavior not well-defined, Andrew J. Schorr, 2020/09/13
- Re: fflush & close behavior not well-defined, arnold, 2020/09/14
- Re: fflush & close behavior not well-defined, Andrew J. Schorr, 2020/09/14
- Re: fflush & close behavior not well-defined, Manuel Collado, 2020/09/14
- Re: fflush & close behavior not well-defined, Andrew J. Schorr, 2020/09/14
- Re: fflush & close behavior not well-defined, Neil R. Ormos, 2020/09/14
- Re: fflush & close behavior not well-defined, Andrew J. Schorr, 2020/09/14
- Re: fflush & close behavior not well-defined,
Neil R. Ormos <=
- Re: fflush & close behavior not well-defined, Andrew J. Schorr, 2020/09/14
- Message not available
- Re: fflush & close behavior not well-defined, Andrew J. Schorr, 2020/09/14
- RE: fflush & close behavior not well-defined, pjfarley3, 2020/09/14
- Re: fflush & close behavior not well-defined, Wolfgang Laun, 2020/09/14
Re: fflush & close behavior not well-defined, Lorenz, 2020/09/15