NAME

File::RandomGenerator - Utility to generate a random dir tree with random files.

VERSION

version 0.06

SYNOPSIS

  my $frg = File::RandomGenerator->new;
  $frg->generate;

  my $frg = File::RandomGenerator->new( 
	  depth     => 2,
	  width     => 3,
	  num_files => 2,
	  root_dir  => '/tmp',
	  unlink    => 1,
  );
  $frg->generate;

ATTRIBUTES

depth

Max directory depth. Default is 1.

num_files

Number of files to create in the root_dir. This number is doubled at each depth level. For example:

/tmp             (10 files)
/tmp/dir_a       (20 files)
/tmp/dir_a/dir_b (40 files)

Default is 10.

root_dir

Directory to put temp files and dirs. Default is /tmp.

Flag to indicate whether or not to unlink the files and directories after the object goes out of scope. Default is 1.

width

Number of subdirs to create at each depth level.

METHODS

new( %attrs )

Constructor, 'nuff said.

generate()

Generate files and directories. Returns the number of files created.

AUTHOR

John Gravatt <john@gravatt.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by John Gravatt.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.