bug-gnulib
[Top][All Lists]
Advanced

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

Re: operations on FILE streams


From: Bruno Haible
Subject: Re: operations on FILE streams
Date: Fri, 13 Apr 2007 12:26:49 +0200
User-agent: KMail/1.5.4

Eric Blake wrote:
> >    The primitives for "fp is not open for writing" can be written in the
> >    same spirit as the 'fseterr' and 'fpending' modules.
> 
> It sounds like you are asking for __freading:
> 
> http://docs.sun.com/app/docs/doc/806-0627/6j9vhfmre?q=__fpurge&a=view
> 
> We probably should provide modules for all of the following useful stdio
> functions that the standards developers left out:
> 
> __fbufsize
> __flbf
> __fpending - done
> __fpurge
> __freadable
> __freading
> __fsetlocking
> __fwritable
> __fwriting
> __flushlbf

Interesting that Solaris has all these. Yes I think such modules would be
useful in gnulib. Except that the gnulib function names should not have a
'__' prefix, since '__' is in the system's namespace.

> __fbufsize

Yes, we need a function 'fbufsize'. It is stupid to be able to replace
the existing buffer of a stream but not to be able to inquire the size of
the current buffer.

> __flbf

Here I would prefer a function that returns the file's mode, one of
_IONBF, _IOLBF, _IOFBF, for symmetry with setvbuf.

> __fpurge

Yes, an fpurge function is useful, since fflush is not guaranteed to do it
on unbuffered input streams.

> __freadable
> __fwritable

Yes, call them freadable and fwritable.

> __freading
> __fwriting

Yes, call them freading and fwriting.

> __fsetlocking

This is probably not implementable. I would drop it.

> __flushlbf

Likewise: we have no portable way to enumerate all open FILE streams
(except for overriding 'fopen', urghh).

Bruno





reply via email to

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