traverseDirs: Traverse and update a tree representing the file system

View source: R/dirchoose.R

traverseDirsR Documentation

Traverse and update a tree representing the file system

Description

This function takes a tree representing a part of the file system and updates it to reflect the current state of the file system as well as the settings for each node. Children (contained folders) are recursed into if the parents expanded element is set to TRUE, no matter if children are currently present.

Usage

traverseDirs(tree, root, restrictions, hidden)

Arguments

tree

A list representing the tree structure of the file system to traverse. Each element should at least contain the elements 'name' and 'expanded'. The elements 'empty' and 'children' will be created or updates if they exist.

root

A string with the location of the root folder for the tree

restrictions

A vector of directories within the root that should be filtered out of the results

hidden

A logical value specifying whether hidden folders should be returned or not

Value

A list of the same format as 'tree', but with updated values to reflect the current file system state.


shinyFiles documentation built on Aug. 19, 2022, 5:07 p.m.