Skip to content

Modern Fs PathIsRoot

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

Home › Filesystem › Filesystem Library › PathIsRoot

PathIsRoot

Returns true if the whole path is just a root, such as C:\ or /.

Syntax

PathIsRoot( p )

Notes

  • the whole path is exactly its root

Examples

#import "std/fs"
using fs

print PathIsRoot( "C:\" )                 '' true
print PathIsRoot( "C:\dev" )             '' false
print PathIsRoot( "\\srv\share\" )      '' true

'' True only when the WHOLE path is exactly its own root, which is the
'' terminating condition for a walk up through PathParent

Library: Filesystem Library
Category: Filesystem
Documented under: Paths

Clone this wiki locally