fs.l0
Module: std.fs
Source: compiler/shared/l0/stdlib/std/fs.l0 Language: Dea/L0
Imports / Includes
std.unitsys.rt
Symbols
Function _fs_from_rt
1
func _fs_from_rt(info: RtFileInfo) -> FileInfo
Convert one runtime metadata record into the public stdlib wrapper type.
Parameters:
info: Runtime metadata record.
Returns: Public stdlib metadata record.
Function stat
1
func stat(path: string) -> FileInfo
Return metadata for a filesystem path.
Parameters:
path: Filesystem path to inspect.
Returns: Metadata record with nullable size and timestamp fields.
Function exists
1
func exists(path: string) -> bool
Return whether any filesystem object exists at a path.
Parameters:
path: Filesystem path to inspect.
Returns: true when the path exists.
Function is_file
1
func is_file(path: string) -> bool
Return whether a path exists and is a regular file.
Parameters:
path: Filesystem path to inspect.
Returns: true when path is a file.
Function is_dir
1
func is_dir(path: string) -> bool
Return whether a path exists and is a directory.
Parameters:
path: Filesystem path to inspect.
Returns: true when path is a directory.
Function file_size
1
func file_size(path: string) -> int?
Return the size of a file when available.
Parameters:
path: Filesystem path to inspect.
Returns: File size in bytes, or null when unavailable.
Function mtime_sec
1
func mtime_sec(path: string) -> int?
Return the modification time in whole seconds when available.
Parameters:
path: Filesystem path to inspect.
Returns: Unix modification time in seconds, or null when unavailable.
Function delete_file
1
func delete_file(path: string) -> Unit?
Delete the file at the given path.
Parameters:
path: File path to remove.
Returns: present() on success, or null on error.
Function read_file
1
func read_file(path: string) -> string?
Read the entire content of a file.
Parameters:
path: File path to read.
Returns: File contents, or null on error.
Function write_file
1
func write_file(path: string, data: string) -> Unit?
Write the entire content of a file.
Parameters:
path: File path to write.data: String content to write.
Returns: present() on success, or null on error.
Struct FileInfo
Shared file metadata wrapper around sys.rt::RtFileInfo .
FileInfo Field exists
1
exists: bool
FileInfo Field is_file
1
is_file: bool
FileInfo Field is_dir
1
is_dir: bool
FileInfo Field size
1
size: int?
FileInfo Field mtime_sec
1
mtime_sec: int?
FileInfo Field mtime_nsec
1
mtime_nsec: int?