Added relative paths for DirAccess::remove()
Follows similar behaviour to DirAccess::rename()
This commit is contained in:
parent
c0382a1731
commit
d7052ddba3
|
@ -292,7 +292,10 @@ Error DirAccessUnix::rename(String p_path,String p_new_path) {
|
|||
}
|
||||
Error DirAccessUnix::remove(String p_path) {
|
||||
|
||||
p_path=fix_path(p_path);
|
||||
if (p_path.is_rel_path())
|
||||
p_path=get_current_dir().plus_file(p_path);
|
||||
else
|
||||
p_path=fix_path(p_path);
|
||||
|
||||
struct stat flags;
|
||||
if ((stat(p_path.utf8().get_data(),&flags)!=0))
|
||||
|
|
|
@ -310,7 +310,10 @@ Error DirAccessWindows::rename(String p_path,String p_new_path) {
|
|||
|
||||
Error DirAccessWindows::remove(String p_path) {
|
||||
|
||||
p_path=fix_path(p_path);
|
||||
if (p_path.is_rel_path())
|
||||
p_path=get_current_dir().plus_file(p_path);
|
||||
else
|
||||
p_path=fix_path(p_path);
|
||||
|
||||
printf("erasing %s\n",p_path.utf8().get_data());
|
||||
//WIN32_FILE_ATTRIBUTE_DATA fileInfo;
|
||||
|
|
|
@ -183,12 +183,12 @@ size_t DirAccessFlash::get_space_left() {
|
|||
|
||||
Error DirAccessFlash::rename(String p_from, String p_to) {
|
||||
|
||||
return FAILED;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
};
|
||||
|
||||
Error DirAccessFlash::remove(String p_name) {
|
||||
|
||||
return FAILED;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
};
|
||||
|
||||
extern char* psp_drive;
|
||||
|
|
|
@ -297,7 +297,10 @@ Error DirAccessOSX::rename(String p_path,String p_new_path) {
|
|||
}
|
||||
Error DirAccessOSX::remove(String p_path) {
|
||||
|
||||
p_path=fix_path(p_path);
|
||||
if (p_path.is_rel_path())
|
||||
p_path=get_current_dir().plus_file(p_path);
|
||||
else
|
||||
p_path=fix_path(p_path);
|
||||
|
||||
struct stat flags;
|
||||
if ((stat(p_path.utf8().get_data(),&flags)!=0))
|
||||
|
|
Loading…
Reference in New Issue