diff options
| author | marynate | 2014-05-25 11:34:51 +0800 |
|---|---|---|
| committer | marynate | 2014-05-25 14:50:54 +0800 |
| commit | e6c1689b69e9e0ec530902b550c9e1e2d1cd0aae (patch) | |
| tree | ec9350bef9fc1c0bf6bedd73cc5768115dd6efec /platform/flash/dir_access_flash.cpp | |
| parent | 71355aaab7eca64bec694918c6b911a412ad17f0 (diff) | |
| download | godot-e6c1689b69e9e0ec530902b550c9e1e2d1cd0aae.tar.gz godot-e6c1689b69e9e0ec530902b550c9e1e2d1cd0aae.tar.zst godot-e6c1689b69e9e0ec530902b550c9e1e2d1cd0aae.zip | |
Add DirAccess:dir_exist api
Diffstat (limited to 'platform/flash/dir_access_flash.cpp')
| -rw-r--r-- | platform/flash/dir_access_flash.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/platform/flash/dir_access_flash.cpp b/platform/flash/dir_access_flash.cpp index a0f167924..4b8992f9d 100644 --- a/platform/flash/dir_access_flash.cpp +++ b/platform/flash/dir_access_flash.cpp @@ -156,6 +156,26 @@ bool DirAccessFlash::file_exists(String p_file) { return success; }; +bool DirAccessFlash::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; +}; + size_t DirAccessFlash::get_space_left() { return 0; |
