| 1 | package UR::Value::FilesystemPath; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | require UR; | ||
| 6 | our $VERSION = "0.46"; # UR $VERSION; | ||
| 7 | |||
| 8 | UR::Object::Type->define( | ||
| 9 | class_name => 'UR::Value::FilesystemPath', | ||
| 10 | is => 'UR::Value::Text', | ||
| 11 | ); | ||
| 12 | |||
| 13 | sub exists { | ||
| 14 | return -e shift; | ||
| 15 | } | ||
| 16 | |||
| 17 | sub is_dir { | ||
| 18 | return -d shift; | ||
| 19 | } | ||
| 20 | |||
| 21 | sub is_file { | ||
| 22 | return -f shift; | ||
| 23 | } | ||
| 24 | |||
| 25 | sub is_symlink { | ||
| 26 | return -l shift; | ||
| 27 | } | ||
| 28 | |||
| 29 | sub size { | ||
| 30 | return -s shift; | ||
| 31 | } | ||
| 32 | |||
| 33 | 1; |