Class Sys::Filesystem::Stat
In: lib/sys/filesystem.rb
lib/sys/windows/sys/filesystem.rb
lib/sys/unix/sys/filesystem.rb
Parent: Object

Stat objects are returned by the Sys::Filesystem.stat method.

Methods

Constants

RDONLY = 1   Read-only filesystem
NOSUID = 2   Filesystem does not support suid or sgid semantics.
NOTRUNC = 3   Filesystem does not truncate file names longer than name_max.

External Aliases

files -> inodes
files_free -> inodes_free
files_available -> inodes_available
files -> inodes
files_free -> inodes_free
files_available -> inodes_available

Attributes

base_type  [RW]  The filesystem type, e.g. UFS.
base_type  [R]  The file system type, e.g. NTFS, FAT, etc.
block_size  [RW]  The preferred system block size.
block_size  [R]  The file system block size. MS Windows typically defaults to 4096.
blocks  [R]  The total number of blocks available (used or unused) on the file system.
blocks  [RW]  The total number of fragment_size blocks in the filesystem.
blocks_available  [RW]  The number of free blocks available to unprivileged processes.
blocks_available  [R]  The total number of unused blocks available to unprivileged processes.
blocks_free  [R]  The total number of unused blocks.
blocks_free  [RW]  The total number of free blocks in the filesystem.
bytes_available  [R]  The amount of free space available to unprivileged processes.
bytes_free  [R]  The total amount of free space on the partition.
files  [R]  Total number of files/inodes that can be created on the file system. This attribute is always nil on MS Windows.
files  [RW]  The total number of files/inodes that can be created.
files_available  [R]  Total number of available files/inodes for unprivileged processes that can be created on the file system. This attribute is always nil on MS Windows.
files_available  [RW]  The number of free files/inodes available to unprivileged processes.
files_free  [RW]  The total number of files/inodes on the filesystem.
files_free  [R]  Total number of free files/inodes that can be created on the file system. This attribute is always nil on MS Windows.
filesystem_id  [R]  The file system volume id.
filesystem_id  [RW]  The filesystem identifier.
flags  [RW]  A bit mask of flags.
flags  [R]  A bit mask of file system flags.
fragment_size  [R]  Fragment size. Meaningless at the moment.
fragment_size  [RW]  The fragment size, i.e. fundamental filesystem block size.
name_max  [R]  The maximum length of a file name permitted on the file system.
name_max  [RW]  The maximum length of a file name permitted on the filesystem.
path  [RW]  The path of the filesystem.
path  [R]  The path of the file system.

Public Class methods

Creates a new Sys::Filesystem::Stat object. This is meant for internal use only. Do not instantiate directly.

Public Instance methods

Returns the amount of free space available to unprivileged processes.

Returns the total amount of free space on the partition.

Returns the total space on the partition.

Returns the total space on the partition.

Returns the total amount of used space on the partition.

Returns the total amount of used space on the partition.

Returns true if the filesystem is case sensitive for the current path. Typically this will be any path on MS Windows or Macs using HFS.

For a root path (really any path without actual a-z characters) we take a best guess based on the host operating system. However, as a general rule, I do not recommend using this method for a root path.

Returns the percentage of the partition that has been used.

Returns the percentage of the partition that has been used.

[Validate]