aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Path.write.3
blob: 1735f393fab65e9da0a10162c477105b0517d13d (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
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Path.write 3 2025-04-27 "Tomo man-pages"
.SH NAME
Path.write \- write to a file
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Path.write\ :\ func(path:\ Path,\ text:\ Text,\ permissions\ =\ Int32(0o644)\ ->\ Void)
.fi
.SH DESCRIPTION
Writes the given text to the file at the specified path, creating the file if it doesn't already exist. Sets the file permissions as specified. If the file writing cannot be successfully completed, a runtime error is raised.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
path	Path	The path of the file to write to. 	-
text	Text	The text to write to the file. 	-
permissions		The permissions to set on the file if it is created. 	Int32(0o644)
.TE
.SH RETURN
Nothing.

.SH EXAMPLES
.EX
(./file.txt).write("Hello, world!")
.EE