| File-Attributes-Extended documentation | Contained in the File-Attributes-Extended distribution. |
File::Attributes::Extended - Access UNIX extended filesystem attributes with File::Attributes.
Version 0.01
use File::Attributes ':all';
set_attribute('filename', foo => 'bar');
print get_attribute('filename', 'foo'); # bar
This module should not be used directly -- File::Attributes will automatically use it when possible.
If you're sure you don't want the File::Attributes API, see
File::ExtAttr.
This module implements all of the functions File::Attributes expects. See File::Attributes::Base for more information.
Applicable if the file's filesystem supports extended filesystem attributes.
Priority 6 (medium)
Jonathan Rockway, <jrockway at cpan.org>
Please report any bugs or feature requests to
bug-file-attributes-extended at rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Attributes-Extended.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc File::Attributes::Extended
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-Attributes-Extended
Copyright 2007 Jonathan Rockway, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| File-Attributes-Extended documentation | Contained in the File-Attributes-Extended distribution. |
package File::Attributes::Extended; use warnings; use strict; use base 'File::Attributes::Base'; use File::ExtAttr ':all'; our $VERSION = '0.01'; sub priority { 6 }; sub applicable { my $self = shift; my $file = shift; eval { $self->get($file, 'perltest') }; return if $@; # can't use return 1; # can use } sub get { my $self = shift; my $file = shift; my $attr = shift; # make warnings fatal local $SIG{__WARN__} = sub { die "$_[0] ($!)" }; return getfattr($file, $attr); } sub set { my $self = shift; my $file = shift; my $attr = shift; my $value= shift; # make warnings fatal local $SIG{__WARN__} = sub { die "$_[0] ($!)" }; setfattr($file, $attr, $value); return 1; } sub list { my $self = shift; my $file = shift; local $!; my @result = listfattr($file); die "Error listing attributes: $!" if !@result && $!; return @result; } sub unset { my $self = shift; my $file = shift; my $attr = shift; # make warnings fatal local $SIG{__WARN__} = sub { die "$_[0] ($!)" }; return delfattr($file, "$attr"); } 1; __END__
1; # End of File::Attributes::Extended