Skip to content

Modern Fs DirEntry IsDirectory

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

Home › Filesystem › Filesystem Library › DirEntry.IsDirectory

DirEntry.IsDirectory

Returns true if the entry is a folder; a link to a folder reports as a link.

Syntax

DirEntry.IsDirectory( )

Examples

#import "std/fs"
using fs

dim td as FsResultUStr = CreateTempDir( "fbdoc" )
dim as ustring dir_ = td.Value( )
WriteAllText( PathJoin( dir_, "a.txt" ), "aaa" )
WriteAllText( PathJoin( dir_, "b.txt" ), "bb" )
CreateDir( PathJoin( dir_, "sub" ) )
WriteAllText( PathJoin( dir_, "sub", "c.txt" ), "c" )

for each r in ReadDir( dir_ )
    if r.IsOk( ) then
        if r.Value( ).IsDirectory( ) then print r.Value( ).Name( )
    end if
next                         '' sub

RemoveDirAll( dir_ )

Library: Filesystem Library
Category: Filesystem
Documented under: Directories

Clone this wiki locally