diff options
| author | raysan5 <raysan5@gmail.com> | 2018-10-13 15:59:17 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2018-10-13 15:59:17 +0200 |
| commit | c7b601b62465c7d38daed6fcc916bd94fdead1cf (patch) | |
| tree | 887537cbc18b133088b77a9d833d95387910c56d /src | |
| parent | fc4e9e7a37a0f8470c17a2b35b5611ad340a3cb2 (diff) | |
| download | raylib-c7b601b62465c7d38daed6fcc916bd94fdead1cf.tar.gz raylib-c7b601b62465c7d38daed6fcc916bd94fdead1cf.zip | |
Renamed new PR function
RENAME: GetLastWriteTime() to GetFileModTime()
Diffstat (limited to 'src')
| -rw-r--r-- | src/core.c | 11 | ||||
| -rw-r--r-- | src/raylib.h | 2 |
2 files changed, 8 insertions, 5 deletions
@@ -1682,15 +1682,18 @@ void ClearDroppedFiles(void) #endif } -// Get the last write time of a file -long GetLastWriteTime(const char *fileName) +// Get file modification time (last write time) +RLAPI long GetFileModTime(const char *fileName) { - struct stat result = {0}; + struct stat result = { 0 }; + if (stat(fileName, &result) == 0) { time_t mod = result.st_mtime; - return mod; + + return (long)mod; } + return 0; } diff --git a/src/raylib.h b/src/raylib.h index 1765b40b..e0b6a5a4 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -880,7 +880,7 @@ RLAPI bool ChangeDirectory(const char *dir); // Change work RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window RLAPI char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed) RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) -RLAPI long GetLastWriteTime(const char *fileName); // Get last write time of a file +RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) // Persistent storage management RLAPI void StorageSaveValue(int position, int value); // Save integer value to storage file (to defined position) |
