Merge pull request #7030 from volzhs/fix-dir-access-android

Fix Directory.dir_exist/get_current_dir for 'res://' on Android
This commit is contained in:
Rémi Verschelde 2016-11-09 12:54:59 +01:00 committed by GitHub
commit 22542bc767
2 changed files with 7 additions and 2 deletions

View File

@ -154,7 +154,7 @@ Error DirAccessJAndroid::change_dir(String p_dir){
String DirAccessJAndroid::get_current_dir(){
return "/"+current_dir;
return "res://"+current_dir;
}
bool DirAccessJAndroid::file_exists(String p_file){
@ -268,6 +268,6 @@ DirAccessJAndroid::DirAccessJAndroid() {
DirAccessJAndroid::~DirAccessJAndroid() {
list_dir_end();;
list_dir_end();
}
#endif

View File

@ -288,6 +288,11 @@ public class GodotIO {
try {
ad.files = am.list(path);
// no way to find path is directory or file exactly.
// but if ad.files.length==0, then it's an empty directory or file.
if (ad.files.length==0) {
return -1;
}
} catch (IOException e) {
System.out.printf("Exception on dir_open: %s\n",e);