Rudiments: filesystem Class Reference

Rudiments

- Main Page
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
filesystem Class Reference

## Public Member Functions
| filesystem ()
| filesystem (const filesystem &f)
filesystem & | operator= (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::filesystem | ( |  | ) |

Creates an instance of the filesystem class.

filesystem::filesystem | ( | const filesystem & | f | ) |

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

virtual filesystem::~filesystem | ( |  | ) |
| virtual

Deletes this instance of the filesystem class.

## Member Function Documentation

bool filesystem::close | ( |  | ) |

Closes the currently open filesystem.

int64_t filesystem::getAsyncReads | ( |  | ) | const

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

int64_t filesystem::getAsyncWrites | ( |  | ) | const

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

int64_t filesystem::getAvailableBlocks | ( |  | ) | const

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

int64_t filesystem::getAvailableFileNodes | ( |  | ) | const

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

int64_t filesystem::getBlockSize | ( |  | ) | const

Returns the fundamental block size of the filesystem.

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.

const char* filesystem::getDeviceName | ( |  | ) | const

Returns the name of the device file for the filesystem.

int64_t filesystem::getFileSystemId | ( |  | ) | const

Returns the file system id.

const char* filesystem::getFilesystemSpecificString | ( |  | ) | const

Returns the filesystem-specific string.

int64_t filesystem::getFreeBlocks | ( |  | ) | const

Returns the number of free blocks in the filesystem.

int64_t filesystem::getFreeFileNodes | ( |  | ) | const

Returns the number of free file nodes.

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

int64_t filesystem::getMaximumFileNameLength | ( |  | ) | const

Returns the maximum length of filenames on the filesystem.

const char* filesystem::getMountPoint | ( |  | ) | const

Returns the mount point of the filesystem.

int64_t filesystem::getOptimumTransferBlockSize | ( |  | ) | const

Returns the optimum transfer block size.

uid_t filesystem::getOwner | ( |  | ) | const

Returns the id of the user that mounted the filesystem.

int64_t filesystem::getReservedBlocks | ( |  | ) | const

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

int64_t filesystem::getReservedFileNodes | ( |  | ) | const

Returns the number of file nodes reserved for superuser accounts.

int64_t filesystem::getSyncReads | ( |  | ) | const

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

int64_t filesystem::getSyncWrites | ( |  | ) | const

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

int64_t filesystem::getTotalBlocks | ( |  | ) | const

Returns the total number of blocks allocated for the filesystem.

int64_t filesystem::getTotalFileNodes | ( |  | ) | const

Returns the number of file nodes on the filesystem.

int64_t filesystem::getType | ( |  | ) | const

Returns a number representing the filesystem type.

const char* filesystem::getTypeName | ( |  | ) | const

Returns the name of the filesystem type.

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.

bool filesystem::open | ( | int32_t | fd | ) |

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

Returns true on success and false on failure.

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

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