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

Inherits object.

Public Member Functions

 filesystem ()
 
virtual ~filesystem ()
 
bool open (const char *path)
 
bool open (int32_t fd)
 
bool close ()
 
bool getCurrentProperties ()
 
int64_t getType ()
 
int64_t getBlockSize ()
 
int64_t getOptimumTransferBlockSize ()
 
int64_t getTotalBlocks ()
 
int64_t getFreeBlocks ()
 
int64_t getAvailableBlocks ()
 
int64_t getReservedBlocks ()
 
int64_t getTotalFileNodes ()
 
int64_t getFreeFileNodes ()
 
int64_t getAvailableFileNodes ()
 
int64_t getReservedFileNodes ()
 
int64_t getFileSystemId ()
 
int64_t getMaximumFileNameLength ()
 
uid_t getOwner ()
 
int64_t getSyncWrites ()
 
int64_t getAsyncWrites ()
 
const char * getTypeName ()
 
const char * getMountPoint ()
 
int64_t getSyncReads ()
 
int64_t getAsyncReads ()
 
const char * getDeviceName ()
 
const char * getFilesystemSpecificString ()
 
void * getInternalFilesystemStatisticsStructure ()
 
- Public Member Functions inherited from object
virtual ~object ()
 

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()

filesystem::filesystem ( )

Creates an instance of the filesystem class.

◆ ~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 ( )

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

◆ getAsyncWrites()

int64_t filesystem::getAsyncWrites ( )

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

◆ getAvailableBlocks()

int64_t filesystem::getAvailableBlocks ( )

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

◆ getAvailableFileNodes()

int64_t filesystem::getAvailableFileNodes ( )

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

◆ getBlockSize()

int64_t filesystem::getBlockSize ( )

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 ( )

Returns the name of the device file for the filesystem.

◆ getFileSystemId()

int64_t filesystem::getFileSystemId ( )

Returns the file system id.

◆ getFilesystemSpecificString()

const char* filesystem::getFilesystemSpecificString ( )

Returns the filesystem-specific string.

◆ getFreeBlocks()

int64_t filesystem::getFreeBlocks ( )

Returns the number of free blocks in the filesystem.

◆ getFreeFileNodes()

int64_t filesystem::getFreeFileNodes ( )

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 ( )

Returns the maximum character length of filenames on the filesystem.

◆ getMountPoint()

const char* filesystem::getMountPoint ( )

Returns the mount point of the filesystem.

◆ getOptimumTransferBlockSize()

int64_t filesystem::getOptimumTransferBlockSize ( )

Returns the optimum transfer block size.

◆ getOwner()

uid_t filesystem::getOwner ( )

Returns the id of the user that mounted the filesystem.

◆ getReservedBlocks()

int64_t filesystem::getReservedBlocks ( )

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

◆ getReservedFileNodes()

int64_t filesystem::getReservedFileNodes ( )

Returns the number of file nodes reserved for superuser accounts.

◆ getSyncReads()

int64_t filesystem::getSyncReads ( )

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

◆ getSyncWrites()

int64_t filesystem::getSyncWrites ( )

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

◆ getTotalBlocks()

int64_t filesystem::getTotalBlocks ( )

Returns the total number of blocks allocated for the filesystem.

◆ getTotalFileNodes()

int64_t filesystem::getTotalFileNodes ( )

Returns the number of file nodes on the filesystem.

◆ getType()

int64_t filesystem::getType ( )

Returns a number representing the filesystem type.

◆ getTypeName()

const char* filesystem::getTypeName ( )

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.