(39 lines)
1 '\" t2 .\" Copyright (c) 2026 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH Path.write_unique_bytes 3 2026-03-08 "Tomo man-pages"6 .SH NAME7 Path.write_unique_bytes \- write bytes to a uniquely named file8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI Path.write_unique_bytes\ :\ func(path:\ Path,\ bytes:\ [Byte]\ ->\ Path)13 .fi14 .SH DESCRIPTION15 Writes the given bytes to a unique file path based on the specified path. The file is created if it doesn't exist. This is useful for creating temporary files.18 .SH ARGUMENTS20 .TS21 allbox;22 lb lb lbx23 l l l.24 Name Type Description25 path Path The base path for generating the unique file. This path must include the string \fBXXXXXX\fR in the file base name.26 bytes [Byte] The bytes to write to the file.27 .TE28 .SH RETURN29 The path of the newly created unique file.31 .SH EXAMPLES32 .EX33 created := (./file-XXXXXX.txt).write_unique_bytes([1, 2, 3])!34 assert created == (./file-27QHtq.txt)35 assert created.read_bytes()! == [1, 2, 3]36 created.remove()!37 .EE38 .SH SEE ALSO39 .BR Tomo-Path (3)