owned?

stat.owned? â true or false Instance Public methods Returns true if the effective user id of the process is the same as the owner of stat. File.stat("testfile").owned? #=> true File.stat("/etc/passwd").owned? #=> false

nlink

stat.nlink â fixnum Instance Public methods Returns the number of hard links to stat. File.stat("testfile").nlink #=> 1 File.link("testfile", "testfile.bak") #=> 0 File.stat("testfile").nlink #=> 2

mtime

stat.mtime â aTime Instance Public methods Returns the modification time of stat. File.stat("testfile").mtime #=> Wed Apr 09 08:53:14 CDT 2003

mode

stat.mode â fixnum Instance Public methods Returns an integer representing the permission bits of stat. The meaning of the bits is platform dependent; on Unix systems, see stat(2). File.chmod(0644, "testfile") #=> 1 s = File.stat("testfile") sprintf("%o", s.mode) #=> "100644"

inspect

stat.inspect â string Instance Public methods Produce a nicely formatted description of stat. File.stat("/etc/passwd").inspect #=> "#<File::Stat dev=0xe000005, ino=1078078, mode=0100644, # nlink=1, uid=0, gid=0, rdev=0x0, size=1374, blksize=4096, # blocks=8, atime=Wed Dec 10 10:16:12 CST 2003, # mtime=Fri Sep 12 15:41:41 CDT 2003, # ctime=Mon Oct 27 11:20:27 CST 2003>"

ino

stat.ino â fixnum Instance Public methods Returns the inode number for stat. File.stat("testfile").ino #=> 1083669

grpowned?

stat.grpowned? â true or false Instance Public methods Returns true if the effective group id of the process is the same as the group id of stat. On Windows NT, returns false. File.stat("testfile").grpowned? #=> true File.stat("/etc/passwd").grpowned? #=> false

gid

stat.gid â fixnum Instance Public methods Returns the numeric group id of the owner of stat. File.stat("testfile").gid #=> 500

ftype

stat.ftype â string Instance Public methods Identifies the type of stat. The return string is one of: âfile'', âdirectory'', âcharacterSpecial'', âblockSpecial'', âfifo'', âlink'', âsocket'', or âunknown''. File.stat("/dev/tty").ftype #=> "characterSpecial"

file?

stat.file? â true or false Instance Public methods Returns true if stat is a regular file (not a device file, pipe, socket, etc.). File.stat("testfile").file? #=> true