blob: 779bb3976824ce75096d0acf72d6620b1be1bf66 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Path.read 3 2025-09-21 "Tomo man-pages"
.SH NAME
Path.read \- read file contents
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Path.read\ :\ func(path:\ Path\ ->\ Text?)
.fi
.SH DESCRIPTION
Reads the contents of the file at the specified path or none if the file could not be read.
.SH ARGUMENTS
.TS
allbox;
lb lb lbx lb
l l l l.
Name Type Description Default
path Path The path of the file to read. -
.TE
.SH RETURN
The contents of the file. If the file could not be read, none will be returned. If the file can be read, but is not valid UTF8 data, an error will be raised.
.SH EXAMPLES
.EX
assert (./hello.txt).read() == "Hello"
assert (./nosuchfile.xxx).read() == none
.EE
|