summaryrefslogtreecommitdiff
path: root/core/os/dir_access.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/os/dir_access.cpp')
-rw-r--r--core/os/dir_access.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index a1031cf5f0..d0baae5872 100644
--- a/core/os/dir_access.cpp
+++ b/core/os/dir_access.cpp
@@ -56,6 +56,17 @@ String DirAccess::_get_root_string() const {
return "";
}
+int DirAccess::get_current_drive() {
+
+ String path = get_current_dir().to_lower();
+ for(int i=0;i<get_drive_count();i++) {
+ String d = get_drive(i).to_lower();
+ if (path.begins_with(d))
+ return i;
+ }
+
+ return 0;
+}
static Error _erase_recursive(DirAccess *da) {