#include <FileChecker.h>
Public Member Functions | |
FileChecker (const string &filename) | |
Create a FileChecker object. | |
bool | changed (unsigned int throttleRate=0) |
Checks whether the file's timestamp has changed or has been created or removed since the last call to changed(). |
Example:
FileChecker checker("foo.txt"); checker.changed(); // false writeToFile("foo.txt"); checker.changed(); // true checker.changed(); // false
FileChecker uses stat() to retrieve file information. FileChecker also supports throttling in order to limit the number of stat() calls. This can improve performance on systems where disk I/O is a problem.
Passenger::FileChecker::FileChecker | ( | const string & | filename | ) | [inline] |
bool Passenger::FileChecker::changed | ( | unsigned int | throttleRate = 0 |
) | [inline] |
Checks whether the file's timestamp has changed or has been created or removed since the last call to changed().
throttleRate | When set to a non-zero value, throttling will be enabled. stat() will be called at most once per throttleRate seconds. |
SystemException | Something went wrong while retrieving the system time. stat() errors will not result in SystemException being thrown. | |
boost::thread_interrupted |