Documentation ¶
Overview ¶
tree is a workalike for the unix tree command
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Flag_a is the value of the -a command line option. If true, then // the tree includes hidden files. Flag_a bool // Flag_d is the valud of the -d command line option. If true, then // only directories are printed Flag_d bool // Flag_L is the value of the -L command line option. If specified, // limits the depth of the subdirectories included. Flag_L int // Flag_noreport is the value of the --noreport command line option. // If true, the program does not print the number of directories and // files at the end of the tree. Flag_noreport bool // NFiles is used to keep track of how many files have been printed. NFiles int // NDirs is used to keep track of how many directories have been // printed. NDirs int )
Package-global variables
Functions ¶
func PrintTree ¶
func PrintTree(node INode)
PrintTree walks the tree from this node down, printing each line
func TreeString ¶
TreeString creates a string representation of this file or directory
Types ¶
type Dir ¶
type Dir struct { Node // contains filtered or unexported fields }
Dir is an implementation of INode for a directory
type INode ¶
type INode interface { GetName() string // The node name GetParent() *Dir // The containing directory node GetLevel() int // How far removed from root node IsLast() bool // True if this is the last child of the parent }
INode represents a file or directory
type Node ¶
type Node struct { INode // contains filtered or unexported fields }
Node is the base class from which File and Dir inherit
Click to show internal directories.
Click to hide internal directories.