followLinks property

bool followLinks
final

Whether symbolic links are resolved.

When false (the default), every link is listed as a file with Link data and is never read, so the tree never leaves the directory you loaded.

When true, a link to a directory is listed as a directory with Directory data, and its children are read through the link's path like any other directory's; a link to a file is listed as a file with File data. Both keep the link's own path. A broken link, a link to the directory being listed, and a link whose target cannot be resolved stay files with Link data.

A link can lead back to one of its own ancestors. loadTree never reads such a directory ahead of time, so it always finishes; the directory stays without children and still loads one level each time it is expanded. Following links costs extra file-system calls: up to two per link and two per directory read.

Implementation

final bool followLinks;