method
size
ruby latest stable - Class:
File
size()public
static VALUE
rb_file_size(VALUE obj)
{
rb_io_t *fptr;
struct stat st;
GetOpenFile(obj, fptr);
if (fptr->mode & FMODE_WRITABLE) {
rb_io_flush_raw(obj, 0);
}
if (fstat(fptr->fd, &st) == -1) {
rb_sys_fail_path(fptr->pathv);
}
return OFFT2NUM(st.st_size);
} Related methods
- Instance methods
- atime
- birthtime
- chmod
- chown
- ctime
- flock
- lstat
- mtime
- path
- size
- to_path
- truncate
- Class methods
- absolute_path
- atime
- basename
- birthtime
- blockdev?
- chardev?
- chmod
- chown
- ctime
- delete
- directory?
- dirname
- empty?
- executable?
- executable_real?
- exist?
- exists?
- expand_path
- extname
- file?
- fnmatch
- fnmatch?
- ftype
- grpowned?
- identical?
- join
- lchmod
- lchown
- link
- lstat
- lutime
- mkfifo
- 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?