mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-05 04:03:49 +01:00
Add convenient function to get file modified time in unix time
This commit is contained in:
1 parent
14f07ac073
commit
c4a432e467
2 files changed
+13
No files matched your search
@@ -137,6 +137,17 @@ bool GetFileInfo(const Path &path, FileInfo * fileInfo) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetModifTimeT(const Path &filename, time_t *return_time) {
|
||||
FileInfo info;
|
||||
if (GetFileInfo(filename, &info)) {
|
||||
*return_time = info.mtime;
|
||||
return true;
|
||||
} else {
|
||||
*return_time = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool GetModifTime(const Path &filename, tm & return_time) {
|
||||
memset(&return_time, 0, sizeof(return_time));
|
||||
FileInfo info;
|
||||
|
||||
@@ -70,6 +70,8 @@ bool IsDirectory(const Path &filename);
|
||||
|
||||
// Returns struct with modification date of file
|
||||
bool GetModifTime(const Path &filename, tm &return_time);
|
||||
// Same but with unix timestamp
|
||||
bool GetModifTimeT(const Path &filename, time_t *return_time); // the time_t, of course, matches time_now_unix_utc().
|
||||
|
||||
// Returns the size of filename (64bit)
|
||||
uint64_t GetFileSize(const Path &filename);
|
||||
|
||||
Reference in new issue
Block a user