vfs: major overhaul — device nodes, stream I/O, mode simplification
- 5-phase VFS architecture overhaul (path resolution, dir cache, watch/notify, symlinks, async API) - Add character/block device node layer with /dev/null and /dev/zero built-ins - RegisterDevice() API for custom device nodes with read/write/size callbacks - Merge TOpenMode + TWriteMode into single TOpenMode enum (omRead, omWrite, omCreate, omReadWrite, omStream) - Add stream write support: WriteFile/WriteFileAsync now accept omStream handles with auto-advancing offset for both device and volume FDs - Add PPWriteOffsetHook type and writeOffsetCallback field to TFilesystem - Add PPReadOffsetHook-based streaming reads for FAT32 and ISO9660 - Update all callers (notepad, edit, inio, wasm runner, filepicker, filedispatch, vterminal, stdio) to new 2-param OpenFile API - 77 unit tests (0 failures) covering path ops, dir cache, symlinks, watch, device nodes, and stream read/write - Add doc/vfs.md — comprehensive public VFS API documentation
This commit is contained in:
1 parent
63b67f5878
commit
fcc9809248
17 files changed
+2774
-417
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -827,6 +827,10 @@ begin
|
||||
dirEntry^.entryType := TDirectory_Entry_Type.directoryEntry
|
||||
else
|
||||
dirEntry^.entryType := TDirectory_Entry_Type.fileEntry;
|
||||
dirEntry^.fileSize := fileEntrys[i].size;
|
||||
dirEntry^.modifiedDate := 0;
|
||||
dirEntry^.modifiedTime := 0;
|
||||
dirEntry^.attributes := fileEntrys[i].attribues;
|
||||
end;
|
||||
|
||||
kfree(void(compString));
|
||||
|
||||
@@ -562,6 +562,19 @@ begin
|
||||
else
|
||||
dirEntry^.entryType := TDirectory_Entry_Type.fileEntry;
|
||||
|
||||
dirEntry^.fileSize := rec^.dataLen_LSB;
|
||||
dirEntry^.attributes := rec^.fileFlags;
|
||||
{ Convert ISO 9660 date (year-1900,month,day,hour,min,sec) to FAT-style }
|
||||
if rec^.recDate[0] >= 80 then
|
||||
dirEntry^.modifiedDate := (uint16(rec^.recDate[0] - 80) shl 9)
|
||||
or (uint16(rec^.recDate[1]) shl 5)
|
||||
or uint16(rec^.recDate[2])
|
||||
else
|
||||
dirEntry^.modifiedDate := 0;
|
||||
dirEntry^.modifiedTime := (uint16(rec^.recDate[3]) shl 11)
|
||||
or (uint16(rec^.recDate[4]) shl 5)
|
||||
or (uint16(rec^.recDate[5]) shr 1);
|
||||
|
||||
offset := offset + rec^.recLen;
|
||||
end;
|
||||
|
||||
@@ -722,6 +735,7 @@ begin
|
||||
filesystem.createDirCallback := nil;
|
||||
filesystem.deleteFileCallback := nil;
|
||||
filesystem.deleteDirCallback := nil;
|
||||
filesystem.renameFileCallback := nil;
|
||||
filesystem.readAsyncCallback := nil;
|
||||
filesystem.readDirAsyncCallback := nil;
|
||||
|
||||
|
||||
Reference in new issue
Block a user