W3cubDocs

/Crystal 0.31

abstract struct File::Info

Overview

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

Direct Known Subclasses

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 : UInt32Source

The group ID that the file belongs to.

abstract def modification_time : TimeSource

The last time this file was modified.

abstract def owner : UInt32Source

The user ID of the file's owner.

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 : UInt64Source

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–2019 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.31.1/File/Info.html