File::Info
Inherits Crystal::System::FileInfo / Struct / Value / Object
A File::Info contains metadata regarding a file.
It is returned by File.info, File#info and File.info?.
Class methods
Returns true if path is executable by the real user id of this process else returns false.
File.write("foo", "foo")
File::Info.executable?("foo") # => false
This method returns the readable property as reported by the file system
which provides no indication of whether Process.execute would be a valid
operation because it applies to all file types, including directories
(which typically are executable to signal it's allowed to list their
contents).
Returns true if path is readable by the real user id of this process else returns false.
File.write("foo", "foo")
File::Info.readable?("foo") # => true
This method returns the readable property as reported by the file system
which provides no indication of whether File.read would be a valid
operation because it applies to all file types, including directories.
Returns true if path is writable by the real user id of this process else returns false.
File.write("foo", "foo")
File::Info.writable?("foo") # => true
This method returns the readable property as reported by the file system
which provides no indication of whether File.write would be a valid
operation because it applies to all file types, including directories.
Instance methods
Returns true if this Info and other are of the same file.
On Unix-like systems, this compares device and inode fields, and will compare equal for hard linked files.
Returns true if this Info represents a symbolic link to another file.
Shortcut for type.symlink?.