aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Path.read_bytes.3
blob: 2ead8236c469ad079a2ffa5cb5a0ea5cd715b4d8 (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
35
36
37
38
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Path.read_bytes 3 2025-04-19T14:48:15.715631 "Tomo man-pages"
.SH NAME
Path.read_bytes \- Reads the contents of the file at the specified path or a null value if the file could not be read.

.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Path.read_bytes\ :\ func(path:\ Path,\ limit:\ Int?\ =\ none\ ->\ [Byte]?)
.fi

.SH DESCRIPTION
Reads the contents of the file at the specified path or a null value if the file could not be read.


.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
path	Path	The path of the file to read. 	-
limit	Int?	A limit to how many bytes should be read. 	none
.TE
.SH RETURN
The byte contents of the file. If the file cannot be read, a null value will be returned.

.SH EXAMPLES
.EX
>> (./hello.txt).read()
= [72, 101, 108, 108, 111]?

>> (./nosuchfile.xxx).read()
= none
.EE