feat: filesystem and Files app support for >64 file entries, 64-bit sizes, async ops, GUI toolkit improvements to devexplorer app
This commit is contained in:
+16
-3
@@ -374,17 +374,30 @@ namespace Fs::Vfs {
|
||||
}
|
||||
|
||||
int VfsReadDir(const char* path, const char** outNames, int maxEntries) {
|
||||
return VfsReadDirAt(path, outNames, maxEntries, 0);
|
||||
}
|
||||
|
||||
int VfsReadDirAt(const char* path, const char** outNames, int maxEntries, int startIndex) {
|
||||
int drive;
|
||||
const char* localPath;
|
||||
|
||||
if (startIndex < 0) return -1;
|
||||
if (!ParsePath(path, drive, localPath)) return -1;
|
||||
if (drive < 0 || drive >= MaxDrives || !driveActive[drive] || driveTable[drive] == nullptr) return -1;
|
||||
|
||||
vfsLock.Acquire();
|
||||
FsDriver* driver = driveTable[drive];
|
||||
int result = (driveActive[drive] && driver && driver->ReadDir)
|
||||
? driver->ReadDir(localPath, outNames, maxEntries)
|
||||
: -1;
|
||||
int result;
|
||||
if (!driveActive[drive] || !driver) {
|
||||
result = -1;
|
||||
} else if (driver->ReadDirAt) {
|
||||
result = driver->ReadDirAt(localPath, outNames, maxEntries, startIndex);
|
||||
} else if (driver->ReadDir) {
|
||||
// Driver without pagination support: only the first page is reachable.
|
||||
result = (startIndex == 0) ? driver->ReadDir(localPath, outNames, maxEntries) : 0;
|
||||
} else {
|
||||
result = -1;
|
||||
}
|
||||
vfsLock.Release();
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user