feat: fix file rename implementation

This commit is contained in:
2026-03-25 07:18:13 +01:00
parent f3ea22935f
commit 5918dc4ee5
10 changed files with 360 additions and 33 deletions
+19
View File
@@ -211,6 +211,25 @@ namespace Fs::Vfs {
return count;
}
int VfsRename(const char* oldPath, const char* newPath) {
int oldDrive, newDrive;
const char* oldLocal;
const char* newLocal;
if (!ParsePath(oldPath, oldDrive, oldLocal)) return -1;
if (!ParsePath(newPath, newDrive, newLocal)) return -1;
// Cross-drive rename not supported
if (oldDrive != newDrive) return -1;
if (oldDrive < 0 || oldDrive >= MaxDrives || driveTable[oldDrive] == nullptr) return -1;
if (driveTable[oldDrive]->Rename == nullptr) return -1;
vfsLock.Acquire();
int result = driveTable[oldDrive]->Rename(oldLocal, newLocal);
vfsLock.Release();
return result;
}
int VfsReadDir(const char* path, const char** outNames, int maxEntries) {
int drive;
const char* localPath;