fileno()
public
Returns an integer representing the numeric file descriptor for
ios.
$stdin.fileno
$stdout.fileno
Show source
/*
* call-seq:
* ios.fileno => fixnum
* ios.to_i => fixnum
*
* Returns an integer representing the numeric file descriptor for
* <em>ios</em>.
*
* $stdin.fileno
* $stdout.fileno
*/
static VALUE
rb_io_fileno(io)
VALUE io;
{
rb_io_t *fptr;
int fd;
GetOpenFile(io, fptr);
fd = fileno(fptr->f);
return INT2FIX(fd);
}