public Method

Stat.size?

state.size     integer

Returns the size of stat in bytes.

File.stat("testfile").size   #=> 66

Source Code

/*
*  call-seq:
*     state.size    => integer
*  
*  Returns the size of <i>stat</i> in bytes.
*     
*     File.stat("testfile").size   #=> 66
*     
*/

static VALUE
rb_stat_s(obj)
   VALUE obj;
{
   off_t size = get_stat(obj)->st_size;

   if (size == 0) return Qnil;
   return OFFT2NUM(size);
}
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.