Skip to content

Modern Fs DirEntry IsSymlink

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

Home › Filesystem › Filesystem Library › DirEntry.IsSymlink

DirEntry.IsSymlink

Returns true if the entry is a symbolic link.

Syntax

DirEntry.IsSymlink( )

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" )

'' The entry is a symlink ITSELF -- the walk does not follow it by
'' default, so this is how a link is recognised rather than descended
for each r in ReadDir( dir_ )
    if r.IsOk( ) then
        if r.Value( ).IsSymlink( ) then print r.Value( ).Name( )
    end if
next                         '' nothing here: no links in this tree
print "done"

RemoveDirAll( dir_ )

Library: Filesystem Library
Category: Filesystem
Documented under: Directories

Clone this wiki locally