abstract struct File::Info

Overview

A File::Info contains metadata regarding a file. It is returned by File.info, File#info and File.info?.

Defined in:

file/info.cr

Constructors

Instance Method Summary

Constructor Detail

def self.newSource

Instance Method Detail

def directory?Source

Returns true if this Info represents a directory. Shortcut for type.directory?.

def file?Source

Returns true if this Info represents a standard file. Shortcut for type.file?.

abstract def flags : FlagsSource

The special flags this file has set.

abstract def group_id : StringSource

The group ID that the file belongs to.

abstract def modification_time : TimeSource

The last time this file was modified.

abstract def owner_id : StringSource

The user ID that the file belongs to.

abstract def permissions : PermissionsSource

The permissions of the file.

abstract def same_file?(other : File::Info) : BoolSource

Returns true if this Info and other are of the same file.

On unix, this compares device and inode fields, and will compare equal for hard linked files.

abstract def size : Int64Source

Size of the file, in bytes.

def symlink?Source

Returns true if this Info represents a symbolic link to another file. Shortcut for type.symlink?.

abstract def type : TypeSource

The type of the file.

© 2012–2021 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/1.2.1/File/Info.html