diff options
| author | Juan Linietsky | 2014-06-11 10:41:43 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-06-11 10:41:43 -0300 |
| commit | 64e83bfd1404ea593f0c79b478d196a3fcde42a8 (patch) | |
| tree | c18c61da239443532a94fb9fa54df702df12a90b /drivers/unix/dir_access_unix.cpp | |
| parent | 9b8696d3dd92e2ed6f310ad0f0bf3c2182c9c6ae (diff) | |
| parent | 5f5cd5e6d1508f85ac1bffa44e122b4dc0e2bb1d (diff) | |
| download | godot-64e83bfd1404ea593f0c79b478d196a3fcde42a8.tar.gz godot-64e83bfd1404ea593f0c79b478d196a3fcde42a8.tar.zst godot-64e83bfd1404ea593f0c79b478d196a3fcde42a8.zip | |
Diffstat (limited to 'drivers/unix/dir_access_unix.cpp')
| -rw-r--r-- | drivers/unix/dir_access_unix.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index fff86c5a7..452d791d9 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -81,6 +81,26 @@ bool DirAccessUnix::file_exists(String p_file) { } +bool DirAccessUnix::dir_exists(String p_dir) { + + GLOBAL_LOCK_FUNCTION + + + if (p_dir.is_rel_path()) + p_dir=current_dir+"/"+p_dir; + else + p_dir=fix_path(p_dir); + + struct stat flags; + bool success = (stat(p_dir.utf8().get_data(),&flags)==0); + + if (success && S_ISDIR(flags.st_mode)) + return true; + + return false; + +} + uint64_t DirAccessUnix::get_modified_time(String p_file) { if (p_file.is_rel_path()) |
