File::TreeCreate(3pm)
π File::TreeCreate π
okay bestie, so this is File::TreeCreate β the Perl module that recursively creates a whole directory tree for you π it lives in the User Contributed Perl Documentation section of your manpages, and honestly? it's giving "I was copy-pasted into like five different test suites and finally got my own glow-up" energy. no cap.
β¨ VERSION β¨
this is version 0.0.1 π¦ tiny number, big dreams.
πΈ SYNOPSIS πΈ
here's the vibe, fr fr β you build a nested hash describing your dream tree, then hand it over and let the module do its thing:
use File::TreeCreate ();
my $t = File::TreeCreate->new();
my $tree = {
'name' => "tree-create--tree-test-1/",
'subs' => [
{
'name' => "b.doc",
'contents' => "This file was spotted in the wild.",
},
{
'name' => "a/",
},
{
'name' => "foo/",
'subs' => [
{
'name' => "yet/",
},
],
},
],
};
$t->create_tree( "./t/sample-data/", $tree );
# TEST
is_deeply(
$t->ls("./t/sample-data/tree-create--tree-test-1"),
[ "a", "b.doc", "foo" ],
"Testing the contents of the root tree"
);
see how it eats? π you describe the tree, you create the tree, you check the tree. periodt.
π DESCRIPTION π
okay so the lore: this module was extracted from several near-identical copies that were living in the tests of some of the author's CPAN distributions π like, the same code was just out there duplicating itself in multiple test dirs, so it got pulled out and given main character energy as its own module. iconic behaviour, honestly.
π METHODS π
π
$obj->cat($path)
slurp the file. π₯€ (yes, literally β it reads the whole thing in.)
π
$obj->create_tree($unix_init_path, $tree)
create the tree. π³ the whole point of the module, the moment we've all been waiting for.
π
$obj->exist($path)
does the path exist π€ that's it, that's the question.
π
$obj->get_path($path)
canonicalize the path from UNIX-like. π§
π
$obj->is_dir($path)
is the path a directory. π
π
$obj->is_file($path)
is the path a file. π
π
$obj->ls($dir_path)
list files in a directory. πβ¨
π
my $obj = File::TreeCreate->new()
instantiates a new object. π«Ά your very own TreeCreate bestie, freshly born.
π¦ SUPPORT π¦
π Websites
okay so these websites have more info about this module and might genuinely help you out, bestie. and as always β in addition to those websites β please use your favorite search engine to discover more resources. π
- MetaCPAN β a modern, open-source CPAN search engine, useful to view POD in HTML format.
<https://metacpan.org/release/File-TreeCreate>
- RT: CPAN's Bug Tracker β the RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN.
<https://rt.cpan.org/Public/Dist/Display.html?Name=File-TreeCreate>
- CPANTS β the CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.
<http://cpants.cpanauthors.org/dist/File-TreeCreate>
- CPAN Testers β the CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions.
<http://www.cpantesters.org/distro/F/File-TreeCreate>
- CPAN Testers Matrix β the CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.
<http://matrix.cpantesters.org/?dist=File-TreeCreate>
- CPAN Testers Dependencies β the CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.
<http://deps.cpantesters.org/?module=File::TreeCreate>
π Bugs / Feature Requests
got a bug? got a feature request? spill it π please report any bugs or feature requests by email to bug-file-treecreate at rt.cpan.org, or through the web interface at <https://rt.cpan.org/Public/Bug/Report.html?Queue=File-TreeCreate>. you will be automatically notified of any progress on the request by the system. love that for you. π«Ά
π» Source Code
the code is open to the world, and available for you to hack on. please feel free to browse it and play with it, or whatever. π₯ if you want to contribute patches, please send me a diff or prod me to pull from your repository :)
<https://github.com/shlomif/perl-File-TreeCreate>
git clone git://github.com/shlomif/perl-File-TreeCreate.git
π AUTHOR π
Shlomi Fish <shlomif@cpan.org> β the icon, the legend. π
π BUGS π
please report any bugs or feature requests on the bugtracker website <https://github.com/shlomif/perl-File-TreeCreate/issues>
when submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. π like, actually include it β future-you will thank you.
π COPYRIGHT AND LICENSE π
this software is Copyright (c) 2021 by Shlomi Fish.
this is free software, licensed under:
The MIT (X11) License
and that's the whole page, bestie!! π this gem was served up by perl v5.36.0, dated 2022-11-19, and it lives in your manpages as File::TreeCreate(3pm) π¦ go build a tree, you've got this π
β¨
π¦ where this page comes from
- debian bookworm: libfile-treecreate-perl 0.0.1-3 Β· MIT
- debian trixie: libfile-treecreate-perl 0.0.1-3 Β· MIT
- ubuntu noble: libfile-treecreate-perl 0.0.1-3 Β· MIT
- ubuntu resolute: libfile-treecreate-perl 0.0.1-3 Β· MIT
- ubuntu stonking: libfile-treecreate-perl 0.0.1-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms