FileSystemTree

FileSystemTree[root]

gives a tree whose keys are the names of files in root, and whose data is the full names of these files.

FileSystemTree[root,levelspec]

gives a tree in which files on levels specified by levelspec are represented by a subtree.

FileSystemTree[root,levelspec,r]

combines levels to give a tree with maximum level r.

Details and Options

Examples

open allclose all

Basic Examples  (3)

Create a tree of all files contained in a directory:

Create a tree of all files through level 2 of the specified directory:

Create a tree containing only those files at level 2 of the specified directory:

Create a flat tree for the same directory:

Options  (12)

Elision  (1)

Display two children of all nodes:

FileNameForms  (1)

By default, all files are included:

By specifying FileNameForms->patt, the tree will be restricted to only those files that match the specified pattern:

IncludeDirectories  (1)

Empty directories have no children by default:

Include All as a child of every directory:

MaxItems  (1)

By default, the tree will contain all files in the specified directory and subdirectories:

By specifying MaxItemsn, the tree will contain at most n items within each directory:

Styling Entire Tree  (4)

Specify labels and styles for all subtrees:

Specify the base style:

Specify the style for the edges and the edges of the tree elements:

Specify the base style and styles for individual tree elements:

Styling Individual Tree Elements  (1)

Specify the style for the generated tree element:

Tree Layout and Graphics Options  (3)

Specify the orientation for the root:

Specify a named embedding:

Specify Graphics options:

Properties & Relations  (1)

TreeExpression[FileSystemTree[root,],"FileSystem"] is equivalent to FileSystemMap[Identity,root,]:

Possible Issues  (1)

When specifying a fixed number of levels, empty directories will be omitted from the resulting tree:

Wolfram Research (2022), FileSystemTree, Wolfram Language function, https://reference.wolfram.com/language/ref/FileSystemTree.html.

Text

Wolfram Research (2022), FileSystemTree, Wolfram Language function, https://reference.wolfram.com/language/ref/FileSystemTree.html.

CMS

Wolfram Language. 2022. "FileSystemTree." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FileSystemTree.html.

APA

Wolfram Language. (2022). FileSystemTree. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileSystemTree.html

BibTeX

@misc{reference.wolfram_2022_filesystemtree, author="Wolfram Research", title="{FileSystemTree}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/FileSystemTree.html}", note=[Accessed: 04-February-2023 ]}

BibLaTeX

@online{reference.wolfram_2022_filesystemtree, organization={Wolfram Research}, title={FileSystemTree}, year={2022}, url={https://reference.wolfram.com/language/ref/FileSystemTree.html}, note=[Accessed: 04-February-2023 ]}