method
size
v1_8_7_72 -
Show latest stable
- Class:
File
size(p1)public
Returns the size of file_name.
/*
* 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);
} Related methods
- Instance methods
- atime
- chmod
- chown
- ctime
- flock
- lstat
- mtime
- o_chmod
- path
- truncate
- Class methods
- atime
- basename
- blockdev?
- catname
- chardev?
- chmod
- chmod
- chown
- compare
- copy
- ctime
- delete
- directory?
- dirname
- executable?
- executable_real?
- exist?
- exists?
- expand_path
- extname
- file?
- fnmatch
- fnmatch?
- ftype
- grpowned?
- identical?
- install
- join
- lchmod
- lchown
- link
- lstat
- makedirs
- move
- mtime
- new
- owned?
- pipe?
- readable?
- readable_real?
- readlink
- rename
- safe_unlink
- setgid?
- setuid?
- size
- size?
- socket?
- split
- stat
- sticky?
- symlink
- symlink?
- syscopy
- truncate
- umask
- unlink
- utime
- writable?
- writable_real?
- zero?