Test::...rHandle(3pm)
β¨ Test::MockFile::DirHandle β the whole vibe β¨
okay so bestie, welcome to the Test::MockFile::DirHandle page, from the User Contributed Perl Documentation corner of the internet π This is the little helper class that rides shotgun with Test::MockFile.
πΈ NAME πΈ
Test::MockFile::DirHandle β it hands out a class object for Test::MockFile to give to your opendir calls. that's it. that's the job. π
π VERSION π
Version 0.039 β yes, current, yes, iconic.
π¦ SYNOPSIS π¦
so here's the tea β β this is a helper class for Test::MockFile, and its only purpose is to give you an object so you can recognize that the handle you got passed is a mocked handle. That's the whole personality.
why does it have to exist at all? because Test::MockFile has to mock the other calls, since there is no tie for opendir handles. like, the tie machinery just doesn't go there, so this class picks up the slack π
# This is what Test::MockFile does. You really shouldn't be doing it directly.
use Test::MockFile::DirHandle;
my $handle = Test::MockFile::DirHandle->new("/fake/path", [qw/. .. a bbb ccc dd/]);
reading that comment again: you really shouldn't be doing it directly. that's not me being dramatic, that's literally written in there. hands off, bestie π
π EXPORT π
No exports are provided by this module. zero. none. nothing's coming out of this box, no cap. π
β SUBROUTINES/METHODS β
π«Ά new
Args: ($class, $dir, $files_array_ref)
Returns a blessed object for Test::MockFile::DirHandle. There are no error conditions handled here β it's just gonna bless and vibe, it's not checking your work.
NOTE: the permanent directory contents live in a hash inside Test::MockFile. But when opendir gets called, a copy gets stored here instead. Why? Because through experimentation, it's been determined that adding files to a dir during an opendir/readdir does not affect what readdir returns. so the snapshot is taken at opendir time and that's the reality readdir lives in. periodt. πΈ
See Test::MockFile.
π AUTHOR π
Todd Rinaldo, "<toddr at cpan.org>" β credit where credit is due, king π
π BUGS π
Please report any bugs or feature requests to:
<https://github.com/cpanel/Test-MockFile>
found a bug? not a you-problem to sit on, go tell the repo fr fr πβ¨
π§ SUPPORT π§
You can find documentation for this module with the perldoc command.
perldoc Test::MockFile::DirHandle
You can also look for information at:
- CPAN Ratings
<https://cpanratings.perl.org/d/Test-MockFile>
- Search CPAN
<https://metacpan.org/release/Test-MockFile>
π LICENSE AND COPYRIGHT π
Copyright 2018 cPanel L.L.C.
All rights reserved.
This is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
and that's the whole page, bestie π go forth and mock directories responsibly. π¦
this little tour was brought to you by perl v5.40.1, dated 2026-03-27, straight from the Test::...rHandle(3pm) manual page β catch you in the next one π
π¦ where this page comes from
- ubuntu stonking: libtest-mockfile-perl 0.039-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms