~/bend-docscommunity

src/FilesCompat.bend relies on unsafe/foreign

raw source on the hub · import mylsm-lsm-store@0.6.0.2/src/FilesCompat.bend as FilesCompat

1 import
import Base

Types

type FileType source · line 4 · raw

Data

Classifies the filesystem object reported by a metadata lookup.

type Info source · line 10 · raw

Data

Stores the kind, size, and modification time returned by stat.

Definitions

def kind_from_nat source · line 18 · raw

@kind:Nat -> FileType

Maps the operating-system kind code into the public file classification.

def stat.kind source · line 26 · raw

@kind:U32 -> FileType

def stat.result source · line 29 · raw

@result:Result<&1, &1, Pair(U32, String), Pair(U32, Pair(U32, U32))> -> Result<&1, &1, Pair(U32, String), Info>

def stat source · line 38 · raw

@path:String -> IO(Result<&1, &1, Pair(U32, String), Info>)

Reads filesystem metadata for a path.

Effects (foreign code)

effect stat.raw source · line 13 · raw

@path:String -> IO(Result<&1, &1, Pair(U32, String), Pair(U32, Pair(U32, U32))>)

foreign: src/effs/files_compat.c, src/effs/files_compat.js

effect remove source · line 44 · raw

@path:String -> IO(Result<&1, &1, Pair(U32, String), Unit>)

Removes a file or an empty directory at a path.

foreign: src/effs/files_compat.c, src/effs/files_compat.js

effect rename source · line 49 · raw

@from:String -> @to:String -> IO(Result<&1, &1, Pair(U32, String), Unit>)

Renames a path using the filesystem's atomic rename operation.

foreign: src/effs/files_compat.c, src/effs/files_compat.js

effect read.words source · line 53 · raw

@file:File -> @max:U32 -> IO(Pair(File, Result<&1, &1, Pair(U32, String), Pair(U32, Array<U32>)>))

foreign: src/effs/files_compat.c, src/effs/files_compat.js

effect write.words.once source · line 57 · raw

@file:File -> @offset:U32 -> @len:U32 -> @words:Array<U32> -> IO(Pair(File, Result<&1, &1, Pair(U32, String), Pair(U32, Array<U32>)>))

foreign: src/effs/files_compat.c, src/effs/files_compat.js