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
- FileSystemTree uses standard level specifications as in TreeLevel:
-
n levels 1 through n All levels 0 through Infinity Infinity levels 1 through Infinity {n} level n only {n1,n2} levels n1 through n2 - The default value for levelspec in FileSystemTree is {0,Infinity}.
- FileSystemTree takes the same options as Tree.
- Additional options of FileSystemTree include:
-
IncludeDirectories False whether to include All as a leaf of each directory FileNameForms All include files with names of the specified forms MaxItems Infinity maximum items to include from a directory - FileNameForms will accept any forms specification allowed in the first argument of FileNames.
Examples
open allclose allBasic Examples (3)
Options (12)
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)
Tree Layout and Graphics Options (3)
Properties & Relations (1)
TreeExpression[FileSystemTree[root,…],"FileSystem"] is equivalent to FileSystemMap[Identity,root,…]:
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