1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

-fix local and global usage for DirAccess, fixes #791

please test anyway..
This commit is contained in:
Juan Linietsky
2015-04-18 20:11:33 -03:00
parent b66b86b05e
commit 1de1a04b78
5 changed files with 93 additions and 176 deletions

View File

@@ -87,7 +87,7 @@ bool DirAccessUnix::dir_exists(String p_dir) {
if (p_dir.is_rel_path())
p_dir=current_dir+"/"+p_dir;
p_dir=get_current_dir().plus_file(p_dir);
else
p_dir=fix_path(p_dir);
@@ -278,9 +278,16 @@ String DirAccessUnix::get_current_dir() {
Error DirAccessUnix::rename(String p_path,String p_new_path) {
p_path=fix_path(p_path);
p_new_path=fix_path(p_new_path);
if (p_path.is_rel_path())
p_path=get_current_dir().plus_file(p_path);
else
p_path=fix_path(p_path);
if (p_new_path.is_rel_path())
p_new_path=get_current_dir().plus_file(p_new_path);
else
p_new_path=fix_path(p_new_path);
return ::rename(p_path.utf8().get_data(),p_new_path.utf8().get_data())==0?OK:FAILED;
}
Error DirAccessUnix::remove(String p_path) {