public Method

Stat.blocks

stat.blocks     integer or nil

Returns the number of native file system blocks allocated for this file, or nil if the operating system doesn’t support this feature.

File.stat("testfile").blocks   #=> 2

Source Code

/*
*  call-seq:
*     stat.blocks    => integer or nil
*  
*  Returns the number of native file system blocks allocated for this
*  file, or <code>nil</code> if the operating system doesn't 
*  support this feature.
*     
*     File.stat("testfile").blocks   #=> 2
*/

static VALUE
rb_stat_blocks(self)
   VALUE self;
{
#ifdef HAVE_ST_BLOCKS
   return ULONG2NUM(get_stat(self)->st_blocks);
#else
   return Qnil;
#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.