GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GRAPHVIZ::TRAVERSE::FILESYSTEM (3)

.ds Aq ’

NAME

GraphViz::Traverse::Filesystem - Visualize a filesystem with GraphViz

CONTENTS

SYNOPSIS



  use GraphViz::Traverse::Filesystem;
  $g = GraphViz::Traverse::Filesystem->new(
      ratio => compress, bgcolor => beige
  );
  $g->traverse($root);
  print $g->as_debug;



DESCRIPTION

A GraphViz::Traverse::Filesystem object provides methods to traverse a file system and render it with GraphViz.

Inherit this module to define and use custom <B>node_*B> and <B>edge_*B> methods. Example:



  package Foo;
  use strict;
  use warnings;
  use base qw( GraphViz::Traverse::Filesystem );
  sub node_style { return filled }
  sub node_peripheries {
    my $self = shift;
    $_ = shift;
    return !-d $_ && -x $_ ? 2 : 1; # Executable? Get a ring.
  }
  sub node_fillcolor {
    my $self = shift;
    $_ = shift;
    return
        -d $_ ? snow :
        /\.pod$/   ? cadetblue :
        /\.pm$/    ? cadetblue4 :
        /\.cgi$/   ? cadetblue3 :
        /\.pl$/    ? cadetblue2 :
        /(?:readme|changes?)/i ? goldenrod :
        /\.txt$/   ? gold4 :
        /\.css$/   ? plum :
        /\.html?$/ ? plum3 :
        /\.jpe?g$/ ? orchid4 :
        /\.gif$/   ? orchid3 :
        /\.png$/   ? orchid1 :
        /\.t(?:ar\.)?gz$/ ? red3 :
        /\.zip$/   ? red1 :
        /\.dump$/  ? pink :
        yellow;
  }
  sub edge_color { return gray }
  # etc.
  1;



PUBLIC METHODS

    traverse



  $g->traverse($root);



Traverse a file system starting at the given root path and populate the GraphViz object with file nodes-and path-edges.

SEE ALSO

GraphViz

GraphViz::Traverse

COPYRIGHT

Copyright 2006, Gene Boggs, All Rights Reserved

LICENSE

You may use this module under the license terms of the parent GraphViz package.

AUTHOR

Gene Boggs <gene@cpan.org>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GRAPHVIZ::TRAVERSE::FILESYSTEM (3) 2006-05-06

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.