INtime SDK Help

Gets the file descriptor associated with a stream.

#include <stdio.h>

int fileno (FILE *stream);


Pointer to FILE structure.


This function lets you use the file descriptor I/O calls on streams; for example, read, write, and lseek. To mix the two I/O systems read versus fread, and so on), flush all I/O buffers when going from the buffered system (for example, fwrite) to the unbuffered system (for example, write). Otherwise, you are likely to lose data.

Fileno automatically flushes the I/O buffers for the given stream.

Return Values

The file descriptor currently associated with the stream. The result is undefined if stream does not specify an open file.


Versions Defined in Include Link to
INtime 3.0 intime/rt/include/stdio.h stdio.h clib.lib

See Also

read, write, lseek, fread, fwrite, fdopen, filelength, freopen