| 1 | package File::StatX; | ||
| 2 | $File::StatX::VERSION = '0.005'; | ||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use XSLoader; | ||
| 7 | |||
| 8 | XSLoader::load(__PACKAGE__, __PACKAGE__->VERSION); | ||
| 9 | |||
| 10 | use Exporter 'import'; | ||
| 11 | our @EXPORT_OK; | ||
| 12 | push @EXPORT_OK, qw/statx fstatx statxat/; | ||
| 13 | our %EXPORT_TAGS = ( | ||
| 14 | all => \@EXPORT_OK, | ||
| 15 | funcs => [qw/statx fstatx statxat/], | ||
| 16 | masks => [ grep /^STATX_/, @EXPORT_OK ], | ||
| 17 | at => [ grep /^AT_/, @EXPORT_OK ], | ||
| 18 | ); | ||
| 19 | |||
| 20 | use Carp 'croak'; | ||
| 21 | |||
| 22 | sub statx { | ||
| 23 | my ($path, $flags, $mask) = @_; | ||
| 24 | my $result = File::StatX->new; | ||
| 25 | _do_statx(undef, $path, $flags, $mask, $result) or croak "Could not statx: $!"; | ||
| 26 | return $result; | ||
| 27 | } | ||
| 28 | |||
| 29 | sub fstatx { | ||
| 30 | my ($fh, $flags, $mask) = @_; | ||
| 31 | my $result = File::StatX->new; | ||
| 32 | _do_fstatx($fh, $flags, $mask, $result) or croak "Could not statx: $!"; | ||
| 33 | return $result; | ||
| 34 | } | ||
| 35 | |||
| 36 | sub statxat { | ||
| 37 | my ($dir, $path, $flags, $mask) = @_; | ||
| 38 | my $result = File::StatX->new; | ||
| 39 | _do_statx($dir, $path, $flags, $mask, $result) or croak "Could not statx: $!"; | ||
| 40 | return $result; | ||
| 41 | } | ||
| 42 | |||
| 43 | 1; | ||
| 44 | |||
| 45 | # ABSTRACT: StatX for Perl | ||
| 46 | |||
| 47 | __END__ |