Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>fileno</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
fileno

Usage

   #include <stdio.h>
   int fileno(FILE *fp);

Description

   fileno returns the file descriptor associated with stream fp. The fp
   argument must point to a file which is already open.

   The fileno function converts a file pointer to a file descriptor for use
   with the low-level file functions such as close, read and write. Mixing
   of high and low level functions is not recommended.

Example 

   #include <stdio.h>
   #include <stdlib.h>

   int main()
   {

       int fd;
       fd = fileno(stderr);
       printf("The file handle for stderr is %d\n",fd);
       fd = fileno(stdaux);
       printf("The file handle for stdaux is %d\n",fd);
       fd = fileno(stdprn);
       printf("The file handle for stdprn is %d\n",fd);
       return EXIT_SUCCESS;
   }

Return Value

   fileno returns the file descriptor. There is no error return.

See Also

   fopen, freopen



See Also: fopen freopen

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson