File Operations
class FileSystem
#include "FileSystem.h"
The FileSystem class provides static methods for:
- determining if a particular file exists
- determining if a particular directory exists
- determining which of two files has been modified most recently
Methods
static bool FileExists(const string & path);
Returns true if the specified file exists, and false otherwise.
static bool DirectoryExists(const string & path);
Returns true if the specified directory exists, and false otherwise.
static int CompareFileTimestamps(const string & file1, const string & file2);
Compares the last modification times of file1 and file2. Returns one of the following values:
- If file1 has been modified more recently than file2, returns a value greater than zero (> 0)
- If file2 has been modified more recently than file1, returns a value less than zero (< 0)
- If file1 and file2 were last modified at the same time, returns zero (0)
If either file1 or file2 does not exist, a CS240Exception is thrown.
Ken Rodham