A File::Info contains metadata regarding a file. It is returned by File.info, File#info and File.info?.
Returns true if path is executable by the real user id of this process else returns false.
Returns true if path is readable by the real user id of this process else returns false.
Returns true if path is writable by the real user id of this process else returns false.
Returns true if this Info represents a directory.
Returns true if this Info represents a standard file.
The special flags this file has set.
The group ID that the file belongs to.
The last time this file was modified.
The user ID that the file belongs to.
The permissions of the file.
Returns true if this Info and other are of the same file.
Size of the file, in bytes.
Returns true if this Info represents a symbolic link to another file.
The type of the file.
Crystal::System::FileInfo
Crystal::System::FileInfo
Struct
Struct
Value
Object
Object
Object
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.
Returns true if this Info represents a directory. Shortcut for type.directory?.
The permissions of the file.
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?.
© 2012–2026 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/1.19.0/File/Info.html