12345678910111213141516171819202122232425262728293031323334353637383940 | '\" t
.\" Copyright (c) 2026 Bruce Hill
.\" All rights reserved.
.\"
.TH Path.can_read 3 2026-09-01 "Tomo man-pages"
.SH NAME
Path.can_read \- check read permissions
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Path.can_read\ :\ func(path:\ Path\ ->\ Bool)
.fi
.SH DESCRIPTION
Returns whether or not a file can be read 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 read 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 (/usr/include/stdlib.h).can_read()
assert not (/etc/shadow).can_read()
assert not (/non/existant/file).can_read()
.EE
.SH SEE ALSO
.BR Tomo-Path (3)
|