Detailed Description
#include <PFile.h>
Member Function Documentation
◆ CheckExistsAndIsExecutable()
Returns PResult::C_OK if the specified file exists and is executable, another result otherwise.
- See also
- Exists()
◆ CheckExistsAndIsReadable()
|
static |
Returns PResult::C_OK if the specified file exists and is readable, another result otherwise.
This function can also checks for generic file using the second (optional) argument. Example1: if the second argument is 0 and the filename is "images%04d.jpg", then the function will try to find the file "images0000.jpg". Example2: if the second argument is 99 and the filename is "images%04d.jpg", then the function will try to find any file in the list { "images0000.jpg" .. "images0099.jpg" }. It will return true if at least one of these files can be found.
Common idiom is the following:
- See also
- Exists()
- IsReadable()
◆ Copy()
|
static |
Copies the specified file.
Returns PResult::C_OK if success, another result otherwise.
◆ Exists()
|
static |
Returns true if the specified file exists, false otherwise.
◆ GetAbsoluteFilePath()
Returns an absolute path including the file name.
The absolute path name consists of the full path and the file name. On Unix this will always begin with the root, '/', directory. On Windows this will always begin 'D:/' where D is a drive letter, except for network shares that are not mapped to a drive letter, in which case the path will begin '//sharename/'.
◆ GetAbsolutePath()
Returns a file's path absolute path.
This doesn't include the file name. On Unix the absolute path will always begin with the root, '/', directory. On Windows this will always begin 'D:/' where D is a drive letter, except for network shares that are not mapped to a drive letter, in which case the path will begin '//sharename/'.
◆ GetFilenameWithoutPath()
Returns the filename without the path.
◆ GetLastModified()
Returns the date and local time when the file was last modified.
◆ GetMD5()
DEPRECATED, use MD5() instead.
Computes the MD5 hash sum of the specified file or an empty string if the file does not exist or cannot be read. Note: the MD5 of an existing empty file is "d41d8cd98f00b204e9800998ecf8427e".
◆ GetSize()
|
static |
Returns the size of the specified file in bytes or 0 if the file does not exist.
◆ IsExecutable()
|
static |
Returns true if the specified file exists AND is executable, false otherwise.
◆ IsReadable()
|
static |
Returns true if the specified file exists AND is readable, false otherwise.
- See also
- Exists()
- CheckExistsAndIsReadable()
◆ IsWritable()
|
static |
Returns true if the specified file exists AND is writable, false otherwise.
◆ MD5()
Computes the MD5 hash sum of the specified file or an empty string if the file does not exist or cannot be read.
Note: the MD5 of an existing empty file is "d41d8cd98f00b204e9800998ecf8427e".
◆ RandomFilename() [1/2]
|
static |
Returns a random filename.
◆ RandomFilename() [2/2]
|
static |
Returns a random filename with the specified prefix and suffix/extension, either in the current working directory of in system's temporary directory (by default).
◆ Remove()
Removes the specified file.
Returns PResult::C_OK if success, another result otherwise.
◆ Rename()
Renames the specified file.
Returns PResult::C_OK if success, another result otherwise.
◆ Unzip()
|
static |
Uncompresses (unzip) the specified file.
Returns PResult::C_OK if success, another result otherwise.
◆ Zip()
|
static |
Compresses (zip) the specified file.
Returns PResult::C_OK if success, another result otherwise.