sys-filesystem.html

Path: sys-filesystem.html
Last Update: Thu Jul 12 09:24:55 -0600 2007

Description


A Ruby interface for getting filesystem information.

Synopsis

   
   require 'sys/filesystem'
   include Sys

   p Filesystem.stat("/") # -> Sys::Filesystem::Stat object
   

Constants

Sys::Filesystem

VERSION

The version of this package, returned as a string.

Sys::Filesystem::Stat

RDONLY

Read only filesystem. See the +flags+ method for more information.

NOSUID

Filesystem does not support suid or sgid semantics. See the +flags+ method for more information.

NOTRUNC

Filesystem does not truncate file names longer than +name_max+. Not supported on all platforms. See the +flags+ method for more information.

Class Methods

Sys::Filesystem

Sys::Filesystem.stat(path)

Returns a Filesystem::Stat object containing information about the +path+ filesystem.

Instance Methods

Sys::Filesystem::Stat

base_type

The filesystem type, e.g. UFS.

block_size

The blockquoteferred system block size.

blocks

The total number of +fragment_size+ blocks in the filesystem.

blocks_available

The number of free blocks available to unprivileged processes.

blocks_free

The total number of free blocks in the filesystem.

files

The total number of files/inodes that can be created.

files_free

The total number of free files/inodes on the file system.

filesystem_id

The filesystem identifier.

flags

A bit mask of flags. See the 'Constants' section for a list of flags.

fragment_size

The fragment size, i.e. fundamental file system block size.

inodes

Alias for +files+.

inodes_free

Alias for +files_free+.

inodes_available

Alias for +files_available+.

name_max

The maximum length of a file name permitted on the file system.

path

The path of the filesystem.

Fixnum helper methods

Fixnum#to_gb

Returns a number in terms of gigabytes.

Fixnum#to_kb

Returns a number in terms of kilobytes

Fixnum#to_mb

Returns a number in terms of megabytes

Known Bugs

None that I am aware of. Please log any bugs you find on the project website at http://www.rubyforge.org/projects/sysutils.

License

Ruby's

Copyright

Copyright 2002-2007, Daniel J. Berger

All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Ruby itself.

Warranty

This package is provided "as is" and without any exblockquotess or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.

Acknowledgements

Mike Hall for his original source code.

Author

Daniel J. Berger
djberg96 at nospam at gmail dot com
imperator on IRC (Freenode)

See Also

mount

[Validate]