You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
added get_creation_time function for gdscript
This commit is contained in:
@@ -124,6 +124,26 @@ uint64_t DirAccessUnix::get_modified_time(String p_file) {
|
||||
return 0;
|
||||
};
|
||||
|
||||
// NEW FUNCTION
|
||||
uint64_t DirAccessUnix::get_creation_time(String p_file) {
|
||||
|
||||
if (p_file.is_rel_path())
|
||||
p_file = current_dir.plus_file(p_file);
|
||||
|
||||
p_file = fix_path(p_file);
|
||||
|
||||
struct stat flags;
|
||||
bool success = (stat(p_file.utf8().get_data(), &flags) == 0);
|
||||
|
||||
if (success) {
|
||||
return flags.st_ctime;
|
||||
} else {
|
||||
|
||||
ERR_FAIL_V(0);
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
|
||||
String DirAccessUnix::get_next() {
|
||||
|
||||
if (!dir_stream)
|
||||
|
||||
Reference in New Issue
Block a user