Static Public Member Functions | |
int | chown (string const &filename, int uid, int gid) |
int | chown (const char *filename, int uid, int gid) |
int | completePath (string &fileName) |
int | completePath (char **, int *size, int dontRealloc=0) |
int | copyFile (string const &src, string const &dest, int overwrite) |
int | copyFile (const char *, const char *, int overwrite) |
int | deleteDirectory (string const &path) |
int | deleteDirectory (const char *path) |
int | deleteFile (string const &file) |
int | deleteFile (const char *) |
int | fileExists (string const &file) |
int | fileExists (const char *) |
time_t | getCreationTime (string const &filename) |
time_t | getCreationTime (const char *filename) |
void | getFileExt (string &ext, string const &filename) |
void | getFileExt (char *ext, const char *filename) |
void | getFilename (string const &path, string &filename) |
void | getFilename (const char *path, char *filename) |
int | getFilenameLength (const char *, int *) |
time_t | getLastAccTime (string const &filename) |
time_t | getLastAccTime (const char *filename) |
time_t | getLastModTime (string const &filename) |
time_t | getLastModTime (const char *filename) |
int | getPathRecursionLevel (string &filename) |
int | getPathRecursionLevel (const char *) |
int | getShortFileName (char *, char *, int) |
int | isDirectory (string &dir) |
int | isDirectory (const char *) |
int | isLink (string &dir) |
int | isLink (const char *) |
int | renameFile (string const &before, string const &after) |
int | renameFile (const char *, const char *) |
int | simpleMakeDirectory (string const &path) |
int | simpleMakeDirectory (const char *path) |
void | splitPath (string const &path, string &dir, string &filename) |
void | splitPath (const char *path, char *dir, char *filename) |
void | splitPathLength (const char *path, int *dir, int *filename) |
Private Member Functions | |
FilesUtility () | |
Private Attributes | |
string | filename |
FileHandle | handle |
|
Don't allow instances for this class. |
|
|
|
Change the owner of the current file, use the value -1 for uid or gid to do not change the value. Return 0 on success.
|
|
Complete the path of the file. Return non-zero on errors.
|
|
Complete the path of the file. Return non-zero on errors.
|
|
|
|
Copy the file from [SRC] to [DEST]. Returns 0 on success.
|
|
|
|
Delete a directory. Return non-zero on errors.
|
|
|
|
Delete an existing file passing the path. Return a non-null value on errors.
|
|
|
|
Returns a non-null value if the given path is a valid file.
|
|
|
|
Returns the time of the file creation. Returns -1 on errors.
|
|
Get the file extension passing its path. Save in ext all the bytes afer the last dot(.) in filename.
|
|
Get the file extension passing its path. Save in ext all the bytes afer the last dot(.) in filename.
|
|
Get the filename from a path.
|
|
Get the filename from a path. Be sure that the filename buffer is at least getFilenameLength(...) bytes before call this function.
|
|
Get the length of the file in the path.
|
|
|
|
Returns the time of the last access to the file. Returns -1 on errors.
|
|
|
|
Returns the time of the last modify to the file. Returns -1 on errors.
|
|
|
|
This funtion iterates through every character of the path The first IF tries to clear out the bars, if it finds one, just advances one character and starts the cycle again The second IF tries to find at least two dots. if it finds only 1, does nothing, WIN32 if it finds 2 or more rec=rec-(number of dots -1) UNIX if it finds 2, decrements rec, if it finds more, increments it considering it's a name if it ends with something else other then a bar of a NULL, then it's a path of the form "/...qwerty/" that should be considered rec++ The last ELSE, catches the rest and advances to the next bar. Return the recursion of the path.
|
|
Get the file path in the short form of the specified file Return -1 on errors.
|
|
|
|
Returns a non-null value if the path is a directory.
|
|
|
|
Returns a non-null value if the given path is a link.
|
|
|
|
Rename the file [BEFORE] to [AFTER]. Returns 0 on success.
|
|
|
|
Create a new directory. Return non-zero on errors.
|
|
Split a path in a dir and a filename.
|
|
Splits a file path into a directory and filename. Path is an input value while dir and filename are the output values.
|
|
Use this function before call splitPath to be sure that the buffers dir and filename are bigger enough to contain the data.
|
|
|
|
|