Merge pull request #18914 from notwarp/master

added get_creation_time function for gdscript
This commit is contained in:
Juan Linietsky
2018-08-10 13:28:47 -03:00
committed by GitHub
24 changed files with 133 additions and 0 deletions

View File

@ -311,6 +311,26 @@ uint64_t FileAccessWindows::_get_modified_time(const String &p_file) {
ERR_FAIL_V(0);
};
// NEW FUNCTION
uint64_t FileAccessWindows::_get_creation_time(const String &p_file) {
String file = fix_path(p_file);
if (file.ends_with("/") && file != "/")
file = file.substr(0, file.length() - 1);
struct _stat st;
int rv = _wstat(file.c_str(), &st);
if (rv == 0) {
return st.st_ctime;
} else {
print_line("no access to " + file);
}
ERR_FAIL_V(0);
};
FileAccessWindows::FileAccessWindows() {
f = NULL;

View File

@ -77,6 +77,7 @@ public:
virtual bool file_exists(const String &p_name); ///< return true if a file exists
uint64_t _get_modified_time(const String &p_file);
uint64_t _get_creation_time(const String &p_file); // NEW FUNCTION
FileAccessWindows();
virtual ~FileAccessWindows();