public Method

IO.sync

ios.sync     true or false

Returns the current ``sync mode’’ of ios. When sync mode is true, all output is immediately flushed to the underlying operating system and is not buffered by Ruby internally. See also IO#fsync.

f = File.new("testfile")
f.sync   #=> false

Source Code

/*
*  call-seq:
*     ios.sync    => true or false
*  
*  Returns the current ``sync mode'' of <em>ios</em>. When sync mode is
*  true, all output is immediately flushed to the underlying operating
*  system and is not buffered by Ruby internally. See also
*  <code>IO#fsync</code>.
*     
*     f = File.new("testfile")
*     f.sync   #=> false
*/

static VALUE
rb_io_sync(io)
   VALUE io;
{
   OpenFile *fptr;

   GetOpenFile(io, fptr);
   return (fptr->mode & FMODE_SYNC) ? Qtrue : Qfalse;
}
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.