Unable rename "folder" to ".folder"
I try to rename folder "folder" to ".folder" and got fail message, but it renamed to "upfolder.folder" where "upfolder" is upper level folder.
Was: \sdcard1\folder Want: \sdcard1\.folder Got: \sdcard1\sdcard1.folder
hello,
in 3.1.2 beta 5, it seems rename process is not working... I made this modification in Main.java lines 1115 to 1122 on my local code :
From
if (!MainActivityHelper.isNewDirectoryRecursive(new HFile(openMode, CURRENT_PATH + "/" + name)) &&
Operations.isFileNameValid(name)) {
if (openMode == OpenMode.FILE)
MAIN_ACTIVITY.mainActivityHelper.rename(openMode, f.getPath(), CURRENT_PATH + "/" + name, getActivity(), BaseActivity.rootMode);
else
MAIN_ACTIVITY.mainActivityHelper.rename(openMode, (f).getPath(), (CURRENT_PATH + "/" + name), getActivity(), BaseActivity.rootMode);
}
To
if (!MainActivityHelper.isNewDirectoryRecursive(new HFile(openMode, CURRENT_PATH + "/" + name)) &&
Operations.isFileNameValid(name)) {
MAIN_ACTIVITY.mainActivityHelper.rename(openMode, (f).getPath(), (CURRENT_PATH + "/" + name), getActivity(), BaseActivity.rootMode);
}
From my understanding, problem was linked to the slash missing between CURRENT_PATH & 'name'. New code will include slash in all cases. I didn't find any bug on rename process with this modification.
Maybe in the past there was a reason to treat the files of type OpenMode.FILE in a different way than the other ? I don't know...
Fixed!