LEOCHARRE::BogusFile - make file of x size with junk data
use LEOCHARRE::BogusFile ':all'; my $size_in_k = make_bogus_file('./t/00.tmp'); make_bogus_file('./t/01.tmp','100') or die("can't make 100k file"); make_bogus_file('./t/01.tmp','1.24M') or die("can't make 100k file");
Not exported by default.
Arg is path to new file. If already on disk, warns and returns undef. Optional arg is size in k for file. If no size is passed, will make a filesize under $LEOCHARRE::BogusFile::MAXLENGTH
Arg is size such as.. 100, 1M, 12.4M, 100k, 100K, etc. Returns what it resolves to in bytes. Throws exception if not a size amount.
This is the max chars to put in file, also max k in file. Default value is 100000, which is about 100k.
Leo Charre leocharre at cpan dot org
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e., under the terms of the "Artistic License" or the "GNU General Public License".
This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the "GNU General Public License" for more details.