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, the return value is the
    handle assigned when the stream was first opened.
 
    Returns:    The file handle.  There is no error return.  If the
                stream does not specify an open file, the result is
                undefined.
 
  -------------------------------- Example ---------------------------------
 
    The following statements open a file and check its length.
 
         #include <stdio.h>
         #include <io.h>
 
         FILE *stream;
         int length;
 
         main()
         {
             if ((stream = fopen("work.dat","r+"))!= NULL) {
                length = filelength(fileno(stream));
             }
         }

Seealso:



This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster