|o||coercing objects with overloaded stringification|
|o||coercing to absolute paths|
This module uses Type::Tiny to define the following subtypes.
Path ensures an attribute is a Path::Tiny object. Strings and objects with overloaded stringification may be coerced.
AbsPath is a subtype of Path (above), but coerces to an absolute path.
These are just like Path and AbsPath, except they check -f to ensure the file actually exists on the filesystem.
These are just like Path and AbsPath, except they check -d to ensure the directory actually exists on the filesystem.
Path just ensures you have a Path::Tiny object.
File and Dir check the filesystem. Dont use them unless thats really what you want.
Be careful if you pass in a File::Temp object. Because the argument is stringified during coercion into a Path::Tiny object, no reference to the original File::Temp argument is held. Be sure to hold an external reference to it to avoid immediate cleanup of the temporary file or directory at the end of the enclosing scope.
A better approach is to use Path::Tinys own tempfile or tempdir constructors, which hold the reference for you.
Foo->new( filename => Path::Tiny->tempfile );
o Path::Tiny o Moose::Manual::Types
Please report any bugs or feature requests through the issue tracker at <https://github.com/dagolden/types-path-tiny/issues>. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
git clone git://github.com/dagolden/types-path-tiny.git
David Golden <firstname.lastname@example.org>
Toby Inkster <email@example.com>
This software is Copyright (c) 2013 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
|perl v5.20.3||TYPES::PATH::TINY (3)||2013-06-21|