Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdio.h>
    int fileno( FILE *stream );

Description:
    The fileno function returns the number of the file handle for the file
    designated by stream.  This number can be used in POSIX input/output
    calls anywhere the value returned by  open can be used.  The following
    symbolic values in <io.h> define the file handles that are associated
    with the C language stdin, stdout, stderr, stdaux, and stdprn files when
    the application is started.

    STDIN_FILENO
        Standard input file number, stdin (0)

    STDOUT_FILENO
        Standard output file number, stdout (1)

    STDERR_FILENO
        Standard error file number, stderr (2)

    STDAUX_FILENO
        Standard auxiliary file number, stdaux (3)

    STDPRN_FILENO
        Standard printer file number, stdprn (4)


Returns:
    The fileno function returns the number of the file handle for the file
    designated by stream.  If an error occurs, a value of -1 is returned and
     errno is set to indicate the error.

See Also:
    open

Example:
    #include <stdio.h>

    void main()
      {
        FILE *stream;

        stream = fopen( "file", "r" );
        printf( "File number is %d\n", fileno( stream ) );
        fclose( stream );
      }

    produces the following:

    File number is 7

Classification:
    POSIX 1003.1

Systems:
    All

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