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 Library Reference - <u>synopsis:</u> 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.  The stdaux and stdprn files are not
    available for Windows NT.

    Value     Meaning

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.

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, Netware

See Also:
    open

See Also:

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