(36 lines)
1 '\" t2 .\" Copyright (c) 2025 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH Path.read 3 2025-11-29 "Tomo man-pages"6 .SH NAME7 Path.read \- read file contents8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI Path.read\ :\ func(path:\ Path\ ->\ Text?)13 .fi14 .SH DESCRIPTION15 Reads the contents of the file at the specified path or none if the file could not be read.18 .SH ARGUMENTS20 .TS21 allbox;22 lb lb lbx23 l l l.24 Name Type Description25 path Path The path of the file to read.26 .TE27 .SH RETURN28 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.30 .SH EXAMPLES31 .EX32 assert (./hello.txt).read() == "Hello"33 assert (./nosuchfile.xxx).read() == none34 .EE35 .SH SEE ALSO36 .BR Tomo-Path (3)