12345678910111213141516171819202122232425262728293031323334353637383940 | '\" t
.\" Copyright (c) 2026 Bruce Hill
.\" All rights reserved.
.\"
.TH Path.can_write 3 2026-09-01 "Tomo man-pages"
.SH NAME
Path.can_write \- check write permissions
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Path.can_write\ :\ func(path:\ Path\ ->\ Bool)
.fi
.SH DESCRIPTION
Returns whether or not a file can be written by the current user/group.
.SH ARGUMENTS
.TS
allbox;
lb lb lbx
l l l.
Name Type Description
path Path The path of the file to check.
.TE
.SH RETURN
`yes` if the file or directory exists and the current user has write permissions, otherwise `no`.
.SH NOTES
This answers about the moment it is asked, and another process can change it immediately after. Do not use it to decide whether an operation will succeed: attempt the operation and handle its `Failure` instead.
.SH EXAMPLES
.EX
assert (/tmp).can_write()
assert not (/etc/passwd).can_write()
assert not (/non/existant/file).can_write()
.EE
.SH SEE ALSO
.BR Tomo-Path (3)
|