feat: vfs - add stat syscall
This commit is contained in:
1 parent
5c02c5fe79
commit
de7edaf623
12 files changed
+110
-1
No files matched your search
@@ -288,6 +288,25 @@ namespace Fs::Vfs {
|
||||
return result;
|
||||
}
|
||||
|
||||
int VfsStat(const char* path, StatInfo& out) {
|
||||
int drive;
|
||||
const char* localPath;
|
||||
|
||||
out = StatInfo{};
|
||||
|
||||
if (!ParsePath(path, drive, localPath)) return -1;
|
||||
if (drive < 0 || drive >= MaxDrives || !driveActive[drive] || driveTable[drive] == nullptr) return -1;
|
||||
if (driveTable[drive]->Stat == nullptr) return -1;
|
||||
|
||||
vfsLock.Acquire();
|
||||
FsDriver* driver = driveTable[drive];
|
||||
int result = (driveActive[drive] && driver && driver->Stat)
|
||||
? driver->Stat(localPath, &out)
|
||||
: -1;
|
||||
vfsLock.Release();
|
||||
return result;
|
||||
}
|
||||
|
||||
int VfsMkdir(const char* path) {
|
||||
int drive;
|
||||
const char* localPath;
|
||||
|
||||
Reference in new issue
Block a user