Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>fileno() get file handle associated with stream (macro)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 fileno()                Get File Handle Associated with Stream (Macro)

 #include   <stdio.h>

 int        fileno(stream);
 FILE       *stream;                     Pointer to FILE structure


    fileno() is a macro that returns the file handle of 'stream'.  If
    'stream' has more than one file handle, fileno() returns the value of
    the handle assigned when the stream was opened.

    Returns:    The file handle.  If the stream does not specify an open
                file, the result is undefined.  There is no error return.

 Portability:   Not supported by ANSI standard.

   -------------------------------- Example ---------------------------------

    The following statements open a file and check its length.

           #include <stdio.h>
           #include <io.h>

           FILE *stream;
           long length;

           main()
           {
               if ((stream = fopen("work.dat","r+"))!= NULL) {
                  length = filelength(fileno(stream));
               }
           }


See Also: filelength() fopen()

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