FileHelperRK
|
Measure file system usage. More...
#include <FileHelperRK.h>
Public Member Functions | |
int | measure (const char *path, bool clearStats=true) |
Measure disk usage for a directory and its subdirectories and files. | |
void | clear () |
Clear the measurement stats. | |
String | toString () const |
Return a readable representation of this class. | |
Data Fields | |
size_t | fileBytes = 0 |
Number of bytes total for all files. | |
size_t | sectors = 0 |
Number of sectors used. | |
size_t | numFiles = 0 |
Number of files. | |
size_t | numDirectories = 0 |
Number of directories. | |
Measure file system usage.
int FileHelperRK::Usage::measure | ( | const char * | path, |
bool | clearStats = true ) |
Measure disk usage for a directory and its subdirectories and files.
path | c-string containing an absolute or relative Unix-style pathname (slash separated) to a file or directory |
clearStats | Call clear() to reset stats |
String FileHelperRK::Usage::toString | ( | ) | const |
Return a readable representation of this class.
size_t FileHelperRK::Usage::fileBytes = 0 |
Number of bytes total for all files.
This is a sum of the file sizes, not the usage on disk.
size_t FileHelperRK::Usage::sectors = 0 |
Number of sectors used.
Each sector is sectorSize bytes. Each file takes one sector for metadata plus enough sectors to hold all of the data. Each directory takes one sector. sectorSize is 4096.
This is an approximate value and may vary from the actual usage.