llm
Download
43 lines 1.4 KiBGroffModified 2026-09-01 raw
12345678910111213141516171819202122232425262728293031323334353637383940414243
'\" t
.\" Copyright (c) 2026 Bruce Hill
.\" All rights reserved.
.\"
.TH Path.subdirectories 3 2026-09-01 "Tomo man-pages"
.SH NAME
Path.subdirectories \- get subdirectories
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Path.subdirectories\ :\ func(path:\ Path,\ include_hidden:\ Bool\ =\ no\ ->\ [Path]?)
.fi
.SH DESCRIPTION
Returns a list of subdirectories within the directory at the specified path. Optionally includes hidden subdirectories.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
path	Path	The path of the directory. 	-
include_hidden	Bool	Whether to include hidden subdirectories (those starting with a \fB.\fR) 	no
.TE
.SH RETURN
A list of subdirectory paths, or `none` if the directory could not be read. A directory with no subdirectories gives an empty list, not `none`.

.SH NOTES
The paths returned keep the form of the path they came from: the children of `(./foo)` are relative and the children of `(~/foo)` stay home-based. Use `.resolved()` on them if you need absolute paths.

.SH ERRORS
Returns `none` if the path is not a readable directory.

.SH EXAMPLES
.EX
assert (./directory).subdirectories()!.sorted() == [(./directory/subdir1), (./directory/subdir2)]
assert (./directory).subdirectories(include_hidden=yes)!.sorted() == [(./directory/.git), (./directory/subdir1), (./directory/subdir2)]
.EE
.SH SEE ALSO
.BR Tomo-Path (3)