Skip to content

Modern Fs GlobRoot

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Filesystem › Filesystem Library › GlobRoot

GlobRoot

Returns the folder a pattern search starts from: the part before the first wildcard.

Syntax

GlobRoot( pattern )

Notes

  • the directory a pattern will be walked from

Examples

#import "std/fs"
using fs

'' The directory a pattern will be walked FROM -- the fixed prefix
'' before the first wildcard
print GlobRoot( "C:\dev\src\*.tiko" )     '' C:\dev\src
print GlobRoot( "C:\dev\**\*.tiko" )      '' C:\dev

'' A pattern with no wildcard at all is its own parent
print GlobRoot( "C:\dev\main.tiko" )       '' C:\dev

'' Pure: it parses the pattern and touches nothing

Library: Filesystem Library
Category: Filesystem
Documented under: Glob

Clone this wiki locally