W3cubDocs

/Crystal

abstract struct File::Info

Overview

A File::Info contains metadata regarding a file. It is returned by File.info, 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.

def group : UInt32Source

The group ID that the file belongs to.

DEPRECATED Use File#group_id instead

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.

def owner : UInt32Source

The user ID that the file belongs to.

DEPRECATED Use File#owner_id instead

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