static public Method

File.size(p1)

File.size(file_name)    integer

Returns the size of file_name.

Source Code

/*
* call-seq:
*    File.size(file_name)   => integer
*
* Returns the size of <code>file_name</code>.
*/

static VALUE
rb_file_s_size(klass, fname)
   VALUE klass, fname;
{
   struct stat st;

   if (rb_stat(fname, &st) < 0)
       rb_sys_fail(StringValueCStr(fname));
   return OFFT2NUM(st.st_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.