1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Add new function

llvm-svn: 10664
This commit is contained in:
Chris Lattner 2003-12-31 06:15:37 +00:00
parent 4665cfa458
commit d6c0c685c1

View File

@ -204,6 +204,19 @@ long long llvm::getFileSize(const std::string &Filename) {
return StatBuf.st_size;
}
/// getFileTimestamp - Get the last modified time for the specified file in an
/// unspecified format. This is useful to allow checking to see if a file was
/// updated since that last time the timestampt was aquired. If the file does
/// not exist or there is an error getting the time-stamp, zero is returned.
unsigned long long llvm::getFileTimestamp(const std::string &Filename) {
struct stat StatBuf;
if (stat(Filename.c_str(), &StatBuf) == -1)
return 0;
return StatBuf.st_mtime;
}
//===----------------------------------------------------------------------===//
// FDHandle class implementation