Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How to get file descriptor (number)

by dave_the_m (Monsignor)
on Sep 13, 2005 at 10:25 UTC ( #491541=note: print w/replies, xml ) Need Help??


in reply to How to get file descriptor (number)

$ perldoc -f fileno fileno FILEHANDLE Returns the file descriptor for a filehandle, or undefined if the filehandle is not open. This is mainly useful for con- structing bitmaps for "select" and low-level POSIX tty-handling operations. If FILEHANDLE is an expression, the value is taken as an indirect filehandle, generally its name. You can use this to find out whether two handles refer to the same underlying descriptor: if (fileno(THIS) == fileno(THAT)) { print "THIS and THAT are dups\n"; } (Filehandles connected to memory objects via new features of "open" may return undefined even though they are open.)

Dave.

Replies are listed 'Best First'.
Re^2: How to get file descriptor (number)
by Eyck (Priest) on Sep 13, 2005 at 12:39 UTC
    Thanks, that is exactly it!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://491541]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2023-03-29 02:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (70 votes). Check out past polls.

    Notices?