method
size
v1_9_3_125 -
Show latest stable
- Class:
File
size(p1)public
Returns the size of file_name.
static VALUE
rb_file_s_size(VALUE klass, VALUE fname)
{
struct stat st;
if (rb_stat(fname, &st) < 0) {
FilePathValue(fname);
rb_sys_fail(RSTRING_PTR(fname));
}
return OFFT2NUM(st.st_size);
} Related methods
- Instance methods
- atime
- chmod
- chown
- ctime
- flock
- lstat
- mtime
- path
- size
- to_path
- truncate
- Class methods
- absolute_path
- atime
- basename
- blockdev?
- chardev?
- chmod
- chown
- ctime
- delete
- directory?
- dirname
- executable?
- executable_real?
- exist?
- exists?
- expand_path
- extname
- file?
- fnmatch
- fnmatch?
- ftype
- grpowned?
- identical?
- join
- lchmod
- lchown
- link
- lstat
- mtime
- new
- open
- owned?
- path
- pipe?
- readable?
- readable_real?
- readlink
- realdirpath
- realpath
- rename
- setgid?
- setuid?
- size
- size?
- socket?
- split
- stat
- sticky?
- symlink
- symlink?
- truncate
- umask
- unlink
- utime
- world_readable?
- world_writable?
- writable?
- writable_real?
- zero?