Rudiments
Public Member Functions | List of all members
filesystem Class Reference

Public Member Functions

 filesystem ()
 
 filesystem (const filesystem &f)
 
filesystemoperator= (const filesystem &f)
 
virtual ~filesystem ()
 
bool open (const char *path)
 
bool open (int32_t fd)
 
bool close ()
 
bool getCurrentProperties ()
 
int64_t getType () const
 
int64_t getBlockSize () const
 
int64_t getOptimumTransferBlockSize () const
 
int64_t getTotalBlocks () const
 
int64_t getFreeBlocks () const
 
int64_t getAvailableBlocks () const
 
int64_t getReservedBlocks () const
 
int64_t getTotalFileNodes () const
 
int64_t getFreeFileNodes () const
 
int64_t getAvailableFileNodes () const
 
int64_t getReservedFileNodes () const
 
int64_t getFileSystemId () const
 
int64_t getMaximumFileNameLength () const
 
uid_t getOwner () const
 
int64_t getSyncWrites () const
 
int64_t getAsyncWrites () const
 
const char * getTypeName () const
 
const char * getMountPoint () const
 
int64_t getSyncReads () const
 
int64_t getAsyncReads () const
 
const char * getDeviceName () const
 
const char * getFilesystemSpecificString () const
 
void * getInternalFilesystemStatisticsStructure ()
 

Detailed Description

The filesystem class provides methods for discovering the properties associated with a filesystem such as type, total and free blocks, total and free inodes, etc.

The native methods for accessing filesystem data vary greatly between platforms and many of these methods only work at all on certain platforms.

Constructor & Destructor Documentation

◆ filesystem() [1/2]

filesystem::filesystem ( )

Creates an instance of the filesystem class.

◆ filesystem() [2/2]

filesystem::filesystem ( const filesystem f)

Creates an instance of the filesystem class that is a copy of "f".

◆ ~filesystem()

virtual filesystem::~filesystem ( )
virtual

Deletes this instance of the filesystem class.

Member Function Documentation

◆ close()

bool filesystem::close ( )

Closes the currently open filesystem.

◆ getAsyncReads()

int64_t filesystem::getAsyncReads ( ) const

Returns the number of asynchronous reads that have occurred since the filesytem was mounted.

◆ getAsyncWrites()

int64_t filesystem::getAsyncWrites ( ) const

Returns the number of asynchronous writes that have occurred since the filesytem was mounted.

◆ getAvailableBlocks()

int64_t filesystem::getAvailableBlocks ( ) const

Returns the number of blocks available to non-superuser accounts on the filesystem.

◆ getAvailableFileNodes()

int64_t filesystem::getAvailableFileNodes ( ) const

Returns the number of file nodes available to non-superuser accounts.

◆ getBlockSize()

int64_t filesystem::getBlockSize ( ) const

Returns the fundamental block size of the filesystem.

◆ getCurrentProperties()

bool filesystem::getCurrentProperties ( )

Refreshes the current filesystem properties as returned by the various methods of this class. Returns true on success and false on failure.

◆ getDeviceName()

const char* filesystem::getDeviceName ( ) const

Returns the name of the device file for the filesystem.

◆ getFileSystemId()

int64_t filesystem::getFileSystemId ( ) const

Returns the file system id.

◆ getFilesystemSpecificString()

const char* filesystem::getFilesystemSpecificString ( ) const

Returns the filesystem-specific string.

◆ getFreeBlocks()

int64_t filesystem::getFreeBlocks ( ) const

Returns the number of free blocks in the filesystem.

◆ getFreeFileNodes()

int64_t filesystem::getFreeFileNodes ( ) const

Returns the number of free file nodes.

◆ getInternalFilesystemStatisticsStructure()

void* filesystem::getInternalFilesystemStatisticsStructure ( )

Returns a pointer to the filesystem stats structure used internally. (This is VERY system-specific and could be struct statfs *, struct statvfs * or something else.)

◆ getMaximumFileNameLength()

int64_t filesystem::getMaximumFileNameLength ( ) const

Returns the maximum character length of filenames on the filesystem.

◆ getMountPoint()

const char* filesystem::getMountPoint ( ) const

Returns the mount point of the filesystem.

◆ getOptimumTransferBlockSize()

int64_t filesystem::getOptimumTransferBlockSize ( ) const

Returns the optimum transfer block size.

◆ getOwner()

uid_t filesystem::getOwner ( ) const

Returns the id of the user that mounted the filesystem.

◆ getReservedBlocks()

int64_t filesystem::getReservedBlocks ( ) const

Returns the number of blocks reserved for superuser accounts on the filesystem.

◆ getReservedFileNodes()

int64_t filesystem::getReservedFileNodes ( ) const

Returns the number of file nodes reserved for superuser accounts.

◆ getSyncReads()

int64_t filesystem::getSyncReads ( ) const

Returns the number of synchronous reads that have occurred since the filesytem was mounted.

◆ getSyncWrites()

int64_t filesystem::getSyncWrites ( ) const

Returns the number of synchronous writes that have occurred since the filesytem was mounted.

◆ getTotalBlocks()

int64_t filesystem::getTotalBlocks ( ) const

Returns the total number of blocks allocated for the filesystem.

◆ getTotalFileNodes()

int64_t filesystem::getTotalFileNodes ( ) const

Returns the number of file nodes on the filesystem.

◆ getType()

int64_t filesystem::getType ( ) const

Returns a number representing the filesystem type.

◆ getTypeName()

const char* filesystem::getTypeName ( ) const

Returns the name of the filesystem type.

◆ open() [1/2]

bool filesystem::open ( const char *  path)

Opens the filesystem containing file or directory "path". If "path" is NULL or an empty string then it the instance is initialized using the current working directoy.

Returns true on success and false on failure.

◆ open() [2/2]

bool filesystem::open ( int32_t  fd)

Initializes the instance to use already open file descriptor "fd".

Returns true on success and false on failure.

◆ operator=()

filesystem& filesystem::operator= ( const filesystem f)

Makes this instance of the filesystem class identical to "f".