Skip to content

Modern Fs FileInfo CanonicalPath

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

Home › Filesystem › Filesystem Library › CanonicalPath

CanonicalPath

Returns the real path with links resolved; it must exist unless allowMissing is true.

Syntax

CanonicalPath( p )
CanonicalPath( p, allowMissing )    '' TRUE: canonicalise the existing prefix, append the missing rest

Notes

  • FsResultUStr

Examples

#import "std/fs"
using fs

'' ASKS THE FILESYSTEM: it resolves every symlink and returns the real
'' path, so it FAILS when the path does not exist
dim r as FsResultUStr = CanonicalPath( "." )

print r.IsOk( )              '' true
print PathIsAbsolute( r.Value( ) )       '' true

dim miss as FsResultUStr = CanonicalPath( "no_such_thing" )
print miss.IsOk( )                       '' false

'' AbsolutePath is the textual one that cannot fail this way

Library: Filesystem Library
Category: Filesystem
Documented under: Metadata

Clone this wiki locally