fix: fix VFS Delete op for Ramdisk driver
This commit is contained in:
@@ -108,14 +108,15 @@ void filemanager_finish_rename(FileManagerState* fm) {
|
||||
filemanager_build_fullpath(new_path, 512,
|
||||
fm->current_path, fm->rename_buf);
|
||||
|
||||
if (fm->is_dir[fm->rename_idx]) {
|
||||
// Directory rename: copy recursively then delete old
|
||||
if (filemanager_copy_dir_recursive(old_path, new_path))
|
||||
filemanager_delete_recursive(old_path);
|
||||
} else {
|
||||
// File rename: copy then delete old
|
||||
if (filemanager_copy_file(old_path, new_path))
|
||||
montauk::fdelete(old_path);
|
||||
if (montauk::frename(old_path, new_path) != 0) {
|
||||
// Fall back to copy + delete for drivers that don't support rename
|
||||
if (fm->is_dir[fm->rename_idx]) {
|
||||
if (filemanager_copy_dir_recursive(old_path, new_path))
|
||||
filemanager_delete_recursive(old_path);
|
||||
} else {
|
||||
if (filemanager_copy_file(old_path, new_path))
|
||||
montauk::fdelete(old_path);
|
||||
}
|
||||
}
|
||||
|
||||
filemanager_read_dir(fm);
|
||||
|
||||
Reference in New Issue
Block a user