mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Add new function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10664 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cf902777e9
commit
81a085a259
@ -204,6 +204,19 @@ long long llvm::getFileSize(const std::string &Filename) {
|
|||||||
return StatBuf.st_size;
|
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
|
// FDHandle class implementation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user