setuid?

stat.setuid? â true or false Instance Public methods Returns true if stat has the set-user-id permission bit set, false if it doesn't or if the operating system doesn't support this feature. File.stat("/bin/su").setuid? #=> true

size

stat.size â fixnum Instance Public methods Returns the size of stat in bytes. File.stat("testfile").size #=> 66

size?

state.size â integer Instance Public methods Returns the size of stat in bytes. File.stat("testfile").size #=> 66

socket?

stat.socket? â true or false Instance Public methods Returns true if stat is a socket, false if it isn't or if the operating system doesn't support this feature. File.stat("testfile").socket? #=> false

sticky?

stat.sticky? â true or false Instance Public methods Returns true if stat has its sticky bit set, false if it doesn't or if the operating system doesn't support this feature. File.stat("testfile").sticky? #=> false

symlink?

stat.symlink? â true or false Instance Public methods Returns true if stat is a symbolic link, false if it isn't or if the operating system doesn't support this feature. As File::stat automatically follows symbolic links, symlink? will always be false for an object returned by File::stat. File.symlink("testfile", "alink") #=> 0 File.stat("alink").symlink? #=> false File.lstat("alink").symlink? #=> true

uid

stat.uid â fixnum Instance Public methods Returns the numeric user id of the owner of stat. File.stat("testfile").uid #=> 501

world_readable?

stat.world_readable? â fixnum or nil Instance Public methods If stat is readable by others, returns an integer representing the file permission bits of stat. Returns nil otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2). m = File.stat("/etc/passwd").world_readable? #=> 420 sprintf("%o", m) #=> "644"

world_writable?

stat.world_writable? â fixnum or nil Instance Public methods If stat is writable by others, returns an integer representing the file permission bits of stat. Returns nil otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2). m = File.stat("/tmp").world_writable? #=> 511 sprintf("%o", m) #=> "777"

writable?

stat.writable? â true or false Instance Public methods Returns true if stat is writable by the effective user id of this process. File.stat("testfile").writable? #=> true