From: Joel VanderWerf Date: 2007-09-12T06:26:11+09:00 Subject: Re: File#file_descriptor Wayne E. Seguin wrote: > Hopefully someone knows this... I've googled for a while. > > When writing a C extension, how does one access the file descriptor of a > File object from the C code? Take a look at this method in io.c: static VALUE rb_io_fileno(io) VALUE io; { OpenFile *fptr; int fd; GetOpenFile(io, fptr); fd = fileno(fptr->f); return INT2FIX(fd); } -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407