(48 lines)
1 '\" t2 .\" Copyright (c) 2025 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH Path.glob 3 2025-11-29 "Tomo man-pages"6 .SH NAME7 Path.glob \- perform file globbing8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI Path.glob\ :\ func(path:\ Path\ ->\ [Path])13 .fi14 .SH DESCRIPTION15 Perform a globbing operation and return a list of matching paths. Some glob specific details:16 - The paths "." and ".." are *not* included in any globbing results.17 - Files or directories that begin with "." will not match `*`, but will match `.*`.18 - Globs do support `{a,b}` syntax for matching files that match any of several19 choices of patterns.21 - The shell-style syntax `**` for matching subdirectories is not supported.24 .SH ARGUMENTS26 .TS27 allbox;28 lb lb lbx29 l l l.30 Name Type Description31 path Path The path of the directory which may contain special globbing characters like \fB*\fR, \fB?\fR, or \fB{...}\fR32 .TE33 .SH RETURN34 A list of file paths that match the glob.36 .SH EXAMPLES37 .EX38 # Current directory includes: foo.txt, baz.txt, qux.jpg, .hidden39 assert (./*).glob() == [(./foo.txt), (./baz.txt), (./qux.jpg)]40 assert (./*.txt).glob() == [(./foo.txt), (./baz.txt)]41 assert (./*.{txt,jpg}).glob() == [(./foo.txt), (./baz.txt), (./qux.jpg)]42 assert (./.*).glob() == [(./.hidden)]44 # Globs with no matches return an empty list:45 assert (./*.xxx).glob() == []46 .EE47 .SH SEE ALSO48 .BR Tomo-Path (3)