diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-08-10 13:28:47 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-10 13:28:47 -0300 |
commit | 275e0d5ee4e80d9d3cd124ffa29a691b9aed3e70 (patch) | |
tree | 6cb7e7f8bec4a2d599ecd0dbbc17f651c56fc710 /drivers/unix/file_access_unix.cpp | |
parent | b9730a695643af15bd97f9b87ae656b735281bba (diff) | |
parent | d315b0fb8aa03ee6ecc7d93d884b606dc19c6ad5 (diff) | |
download | redot-engine-275e0d5ee4e80d9d3cd124ffa29a691b9aed3e70.tar.gz |
Merge pull request #18914 from notwarp/master
added get_creation_time function for gdscript
Diffstat (limited to 'drivers/unix/file_access_unix.cpp')
-rw-r--r-- | drivers/unix/file_access_unix.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index c25d34125d..76b2676c71 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -297,6 +297,22 @@ uint64_t FileAccessUnix::_get_modified_time(const String &p_file) { }; } +// NEW FUNCTION +uint64_t FileAccessUnix::_get_creation_time(const String &p_file) { + + String file = fix_path(p_file); + struct stat flags; + int err = stat(file.utf8().get_data(), &flags); + + if (!err) { + return flags.st_ctime; + } else { + print_line("ERROR IN: " + p_file); + + ERR_FAIL_V(0); + }; +} + Error FileAccessUnix::_chmod(const String &p_path, int p_mod) { int err = chmod(p_path.utf8().get_data(), p_mod); if (!err) { |