fileSize (Function)

Signature: fileSize(path: string) -> Result<int, Error>

Description: The byte length of a regular file, as stat reports it. A missing path or a path that is not a regular file is an Error naming the reason.

Parameters

  • path (string): Path to the file

Returns: Result<int, Error>

Example

match fileSize("model.gguf") {
    Success { value } => print("${value} bytes")
    Error { message } => print(message)
}
match fileSize "model.gguf"
    Success value => print "${value} bytes"
    Error message => print message