fileno
fileno filehandle
- Returns the file descriptor for a filehandle. (A file descriptor is a small integer, unlike the filehandle, which is a symbol.) It returns
undefif the handle is not open. It's useful for constructing bitmaps forselect, and for passing to certain obscure system calls ifsyscallis implemented. It's also useful for double-checking that theopenfunction gave you the file descriptor you wanted.