Skip to content

Modern Fs PathNormalize

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

Home › Filesystem › Filesystem Library › PathNormalize

PathNormalize

Returns a tidied path: . removed, .. resolved as text, duplicate separators collapsed.

Syntax

PathNormalize( p )

Notes

  • collapses '.', resolves '..' LEXICALLY, removes

Examples

#import "std/fs"
using fs

'' Collapses duplicate separators and drops a trailing one
print PathNormalize( "C:\\dev\\\\src\\" )      '' C:\dev\src

'' PURELY TEXTUAL: it resolves . and .. by string arithmetic and never
'' touches the disk, so it cannot know that a component is a symlink
print PathNormalize( "C:\dev\src\..\inc" )     '' C:\dev\inc

'' CanonicalPath is the one that asks the filesystem

Library: Filesystem Library
Category: Filesystem
Documented under: Paths

Clone this wiki locally