(Compatible with UNIX System V C)
#include <fildes.h> fd = fileno( f );
"fileno" returns the file descriptor number of the indicated file. "stdin", "stdout", and "stderr" have stream numbers 0, 1, and 2 respectively. Other files have stream numbers between 3 and 19.
"fileno" returns a -1 in case of error (e.g. the file is not open).
Copyright © 1996, Thinkage Ltd.