Method: File::Stat#size?

Defined in:
file.c

#sizeInteger

Returns the size of stat in bytes.

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

Returns:



5414
5415
5416
5417
5418
5419
5420
5421
# File 'file.c', line 5414

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

    if (size == 0) return Qnil;
    return OFFT2NUM(size);
}