---
name: "Test::TempDir::Factory"
section: "3pm"
platform: "linux"
package: "libtest-tempdir-perl"
version: "0.11-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Test::TempDir::Factory"
---

# Test::TempDir::Factory(3pm)

A factory for creating Test::TempDir::Handle objects

## NAME

Test::TempDir::Factory - A factory for creating Test::TempDir::Handle objects

## VERSION

version 0.11

## SYNOPSIS

```
    my $f = Test::TempDir::Factory->new;
    my $d = $f->create;
    $d->empty;
    # ...
    $d->cleanup
```

## DESCRIPTION

This class creates Test::TempDir::Handle objects with the right `"dir"` parameter, creating directories, and handling fallback logic.

## ATTRIBUTES

### "lock"

No longer used.

### "lock\_opts"

No longer used.

Defaults to `"NONBLOCKING"`

### "lock\_attempts"

No longer used.

Defaults to 2.

### "dir\_name"

The directory under `"t_dir"` to use.

Defaults to `"tmp"`

### "t\_dir"

Defaults to `"t"`

### "use\_subdir"

Whether to always use a temporary subdirectory under the temporary root.

This means that with a `"success"` cleanup policy all failures are retained.

When disabled, `"t/tmp"` will be used directly as `"temp_root"`.

Defaults to true.

### "subdir\_template"

The template to pass to `"tempdir"`. Defaults to `"File::Temp::TEMPXXX"`.

### "handle\_class"

Defaults to Test::TempDir::Handle.

### "verbose"

Whether or not to `"carp"` diagnostics when falling back.

If you subclass this factory and add a `"logger"` method a la MooseX::Logger then this parameter is ignored and all messages will be `"warn"`ed on the logger.

## METHODS

### "create"

Create a Test::TempDir::Handle object with a proper `"dir"` attribute.

## SUPPORT

Bugs may be submitted through the RT bug tracker \<https://rt.cpan.org/Public/Dist/Display.html?Name=Test-TempDir\> (or bug-Test-TempDir@rt.cpan.org \<mailto:bug-Test-TempDir@rt.cpan.org\>).

There is also a mailing list available for users of this distribution, at \<http://lists.perl.org/list/perl-qa.html\>.

There is also an irc channel available for users of this distribution, at `"#perl"` on `"irc.perl.org"` \<irc://irc.perl.org/#perl-qa\>.

## AUTHOR

XXXX XXX'XX (Yuval Kogman) \<nothingmuch@woobling.org\>

## COPYRIGHT AND LICENCE

This software is copyright (c) 2006 by XXXX XXX'XX (Yuval Kogman).

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