9

I'm looking for a (portable) software or script that would allow me to draw a specific file structure as a tree, in Windows XP. Much like DOS tree command, but "prettier" (as a graph or diagram)

I already tried TreeSize but it doesn't suit my needs, as it does not offer any export options nor graphical tweaks.

3
  • Since 'tree' is not good enough, can you specify what you mean by prettier? :)
    – Gareth
    Apr 19, 2011 at 9:07
  • 1
    I would like an image output, or to be able to change the way the tree is represented (horizontally instead of vertically for instance). I would like the links between folders to be plain, not ASCII characters ;) Apr 19, 2011 at 9:12
  • 1
    Why is my question closed ? It is NOT about file system usage ! Apr 27, 2011 at 8:14

2 Answers 2

6

I use a command-line program called "dot" to draw tree structures. To do that, you create a text file defining each file or folder as a unique node and the connections between them (parent to child)

Dot is a part of the Graphviz toolkit, documentation is online at: http://www.graphviz.org/pdf/dotguide.pdf

It can output the drawing as PDF, SVG, PNG, JPG, etc.

Here's an example input file for the "dot" program (file name "test.dot"):

digraph "My File Tree Drawing" {
      /* paper size in inches */
      size="11.0,8.5";
      /* locate label at top of drawing */
      labelloc=t;
      label="My File Tree Drawing";
      /* no directional arrow on connectors */
      edge [dir=none];
      /* nodes below are boxes (folders) */
      node [shape=box];
      folder1 [label="Folder 1 Name"];
      folder2 [label="Folder 2 Name"];
      folder3 [label="Folder 3 Name"];
      /* nodes below are ellipses (files) */
      node [shape=ellipse];
      file1 [label="File 1 Name"];
      file2 [label="File 2 Name"];
      file3 [label="File 3 Name"];
      file4 [label="File 4 Name"];
      /* parent -> child, to draw the tree */
      folder1 -> folder2;
      folder1 -> folder3;
      folder1 -> file1;
      folder2 -> file2;
      folder3 -> file3;
      folder3 -> file4;
}

To make this into a pdf, you would run the command:

dot -T pdf test.dot > test.pdf

This program makes great drawings of file trees (or any tree / graph structure). The part that requires the most work is making the input *.dot file. I usually write a script to look through the file tree and output a text file formatted similar to "test.dot" above. Make sure that ALL NODE NAMES ARE UNIQUE (even if the label/file/folder name is the same). Another useful thing to know, each line in the *.dot file can come in almost any order - if any are duplicates, the last one will override the previous ones.

Additional "dot" documentation is available at http://www.graphviz.org/Documentation.php

0
3

Treeviz - it's a Java app. I'm sure it will work on Windows, but I just happened to be on a Mac.

The trees are interactive. You can move things around and such with your mouse.

Interactive tree

Sunburst

1
  • Yes, it's supposed to run on windows ;) I can't seem to launch it though, it throws a "MissingFieldException" Apr 29, 2011 at 7:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .