public Method

IO.fcntl(...)

ios.fcntl(integer_cmd, arg)     integer

Provides a mechanism for issuing low-level commands to control or query file-oriented I/O streams. Arguments and results are platform dependent. If arg is a number, its value is passed directly. If it is a string, it is interpreted as a binary sequence of bytes (Array#pack might be a useful way to build this string). On Unix platforms, see fcntl(2) for details. Not implemented on all platforms.

Source Code

/*
*  call-seq:
*     ios.fcntl(integer_cmd, arg)    => integer
*  
*  Provides a mechanism for issuing low-level commands to control or
*  query file-oriented I/O streams. Arguments and results are platform
*  dependent. If <i>arg</i> is a number, its value is passed
*  directly. If it is a string, it is interpreted as a binary sequence
*  of bytes (<code>Array#pack</code> might be a useful way to build this
*  string). On Unix platforms, see <code>fcntl(2)</code> for details.
*  Not implemented on all platforms.
*/

static VALUE
rb_io_fcntl(argc, argv, io)
   int argc;
   VALUE *argv;
   VALUE io;
{
#ifdef HAVE_FCNTL
   VALUE req, arg;

   rb_scan_args(argc, argv, "11", &req, &arg);
   return rb_io_ctl(io, req, arg, 0);
#else
   rb_notimplement();
   return Qnil;                /* not reached */
#endif
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.