ICI Modules: posix: fileno


Modules by name : by type

Synopsis

int = fileno(file)

Description

Return the file descriptor associated with a file. If the file is not one that has an file descriptor an error is raised. Files with file descriptors are those returned by the standard fopen function and, on systems that support pipes, the popen function.

Note that socket files as returned by the net.sktopen function are not compatible with this function (they use a different file type for their implementation) and there is currently no function to obtain the socket descriptor from a file opened from a socket.

Errors

Attempt to obtain file descriptor of non-stdio file

The argument was not a file that has an underlying file descriptor.