atime 2

file.atime â time Instance Public methods Returns the last access time (a Time object) for <i>file</i>, or epoch if <i>file</i> has not been accessed. File.new("testfile").atime #=> Wed Dec 31 18:00:00 CST 1969

zero?

File.zero?(file_name) â true or false Class Public methods Returns true if the named file exists and has a zero size. file_name can be an IO object.

writable_real?

File.writable_real?(file_name) â true or false Class Public methods Returns true if the named file is writable by the real user id of this process.

writable?

File.writable?(file_name) â true or false Class Public methods Returns true if the named file is writable by the effective user id of this process.

world_writable?

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

world_readable?

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

utime

File.utime(atime, mtime, file_name,...) â integer Class Public methods Sets the access and modification times of each named file to the first two arguments. Returns the number of file names in the argument list.

unlink

File.unlink(file_name, ...) â integer Class Public methods Deletes the named files, returning the number of names passed as arguments. Raises an exception on any error. See also Dir::rmdir.

umask

File.umask() â integerFile.umask(integer) â integer Class Public methods Returns the current umask value for this process. If the optional argument is given, set the umask to that value and return the previous value. Umask values are subtracted from the default permissions, so a umask of 0222 would make a file read-only for everyone. File.umask(0006) #=> 18 File.umask #=> 6

truncate

File.truncate(file_name, integer) â 0 Class Public methods Truncates the file file_name to be at most integer bytes long. Not available on all platforms. f = File.new("out", "w") f.write("1234567890") #=> 10 f.close #=> nil File.truncate("out", 5) #=> 0 File.size("out") #=> 5