GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
File::Attributes(3) User Contributed Perl Documentation File::Attributes(3)

File::Attributes - Manipulate file metadata

Version 0.04

    use File::Attributes qw(set_attribute list_attributes get_all_attributes);

    my $file = 'foo.txt';
    set_attribute($file, type     => 'text/plain');
    set_attribute($file, encoding => 'utf8');
    
    my @attributes = list_attributes($file);
    #  @attributes = qw(type encoding)
 
    %attributes = get_attributes($file);
    #  $attributes{type} will be 'text/plain'
    #  $attributes{foo}  will be undefined.

"File::Attributes" is a wrapper around modules in the File::Attributes <http://search.cpan.org/search?query=File%3A%3AAttributes> hierarchy. If you use this module directly (instead of one of the aforementioned decendants), then your attribute manipulations will Just Work, regardless of the underlying filesystem.

Module::Pluggable is used to find all "File::Attributes::" modules that inherit from "File::Attributes::Base" and that are applicable on your system. If it finds one, it uses that. If not, it uses "File::Attributes::Simple", which is bundled with this module and works everywhere.

As of version 0.04, plugins are now set up per-file, not per-system. This means that if you have "File::Attributes::Extended" installed, extended attributes will be used where available, but Simple attributes will be used on files where extended attributes don't work (a FAT filesytem on a Linux machine, for example). Existing simple attributes will be read even if extended attributes are available, but writes will affect only the extended attributes.

This means that you can switch to a better attribute plugin at any time, without losing any old data!

None, by default. Specify the functions that you'd like to use as arguments to the module. If you want everything, specify ":all".

All functions throw an exception on error.

Returns the value of attribute $attribute on file $file. If $attribute doesn't exist, returns undefined.

Sets attribute $<attribute> on file $file to $value.

Returns a hash of all attributes on $file.

Sets the attributes named by the keys of %hash to the value contained in %hash. Note that this operation is not atomic -- if setting an individual attribute fails, the attributes on $file may not be the same as before "set_attributes" was called!

Removes the attribute $attribute from $file.

Removes each attribute ($attribute0, $attribute1, "...") from $file.

Returns a list of the attributes on $file. Equivalent to (but faster than) "keys get_attributes($file)".

Jonathan Rockway, "<jrockway at cpan.org>"

Please report any bugs or feature requests to RT at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Attributes>.

Copyright 2006 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.

2007-02-04 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.