Expand description
Native file module for high-level filesystem operations.
Exports: file.read_text, file.write_text, file.read_lines, file.append, file.read_bytes, file.write_bytes
All operations go through FileSystemProvider so that sandbox/VFS modes
work transparently. The default provider is RealFileSystem.
Policy gated: read ops require FsRead, write ops require FsWrite.
Functionsยง
- create_
file_ module - Create the
filemodule using the default real filesystem. - create_
file_ module_ with_ provider - Create a file module that uses the given filesystem provider.
The default
create_file_module()usesRealFileSystem; callers can substitute aPolicyEnforcedFsorVirtualFileSystemfor sandboxing.