Skip to content

Modern Fs FileInfo Exists

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

Home › Filesystem › Filesystem Library › FileInfo.Exists

FileInfo.Exists

Returns true if the FileInfo describes something that exists.

Syntax

FileInfo.Exists( )

Examples

#import "std/fs"
using fs

dim td as FsResultUStr = CreateTempDir( "fbdoc" )
dim as ustring dir_ = td.Value( )
dim as ustring p = PathJoin( dir_, "f.txt" )
WriteAllText( p, "hello" )

dim info as FileInfo = Stat( p ).Value( )
print info.Exists( )         '' true

'' A default-constructed FileInfo -- one from a Stat that failed -- says
'' false rather than pretending
dim blank as FileInfo
print blank.Exists( )        '' false

RemoveDirAll( dir_ )

Library: Filesystem Library
Category: Filesystem
Documented under: Metadata

Clone this wiki locally