Browse the docs

silk.system.filesystem_machine.

A filesystem provider for absolute paths in the host machine namespace.

When to use#

Use MachineFileSystem in host tools that must access more than one directory. Unix paths use /...; Windows paths use /C:/... or /UNC/server/share/.... This provider is not confined to an application directory. Use OsFileSystem for a confined root instead.

Import as MachineFileSystem with import silk.system.filesystem_machine { MachineFileSystem }.

Public declarations: 1.

MachineFileSystem#

silk
pub struct MachineFileSystem

The native filesystem in the absolute machine namespace.

Details#

Unix paths retain their absolute spelling. Windows paths select a drive or UNC share, such as /C:/work/main.silk or /UNC/server/share/main.silk; drive letters are case insensitive and other bytes retain their case and canonical WTF-8 spelling. Windows requires NTFS. Relative symbolic links resolve inside their drive or share; absolute links must name that root with matching spelling except drive-letter case. Unknown reparse tags and other-root targets are unsupported. Resolution stops after 40 links with InvalidPath. Remote atomic publication, directory synchronization, and synchronized publication are unsupported; deletion requires the server's POSIX disposition support. Ordinary UNC reads, writes, creation, and listing are supported. The path / has no Windows volume and fails with InvalidPath. Each drive or share retains its own temporary-name counter for the provider's lifetime.

Implementation MachineFileSystem#

silk
impl MachineFileSystem

Associated function make#

silk
pub effect fn make() -> MachineFileSystem ! OutOfMemoryError ? &mut Allocator

Creates a provider for the machine's absolute paths without opening any directories.

Errors#

  • OutOfMemoryError if the provider's roots cannot be allocated.

Implementation FileSystem for MachineFileSystem#

silk
impl FileSystem for MachineFileSystem

Operation readFile#

silk
readFile: MachineFileSystem.readFile

Operation writeFile#

silk
writeFile: MachineFileSystem.writeFile

Operation createFile#

silk
createFile: MachineFileSystem.createFile

Operation writeFileAtomic#

silk
writeFileAtomic: MachineFileSystem.writeFileAtomic

Operation syncDirectory#

silk
syncDirectory: MachineFileSystem.syncDirectory

Operation stat#

silk
stat: MachineFileSystem.stat

Operation listDirectory#

silk
listDirectory: MachineFileSystem.listDirectory

Operation createDirectory#

silk
createDirectory: MachineFileSystem.createDirectory

Operation removeFile#

silk
removeFile: MachineFileSystem.removeFile

Operation removeDirectory#

silk
removeDirectory: MachineFileSystem.removeDirectory

Operation createTemporaryDirectory#

silk
createTemporaryDirectory: MachineFileSystem.createTemporaryDirectory

Category: System.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, x86_64-unknown-linux-gnu, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc.

View the source of this page