NAME

File::Sticker::Writer::Xattr - write and standardize meta-data from ExtAttr file

VERSION

version 0.9301

SYNOPSIS

use File::Sticker::Writer::Xattr;

my $obj = File::Sticker::Writer::Xattr->new(%args);

my %meta = $obj->write_meta(%args);

DESCRIPTION

This will write meta-data from extended user attributes of files, and standardize it to a common nomenclature, such as "tags" for things called tags, or Keywords or Subject etc.

DEBUGGING

whoami

Used for debugging info

METHODS

is_fallback

Is this writer a fallback writer (to be used when others don't work)? This is mainly to prevent Xattr attributes being set when they don't need to be, because we don't want duplicate information stored in two different ways.

allowed_file

If this writer can be used for the given file, then this returns true. This can be used with any file, if the filesystem supports extended attributes. I don't know how to test for that, so I'll just assume "yes".

allowed_fields

If this writer can be used for the known and wanted fields, then this returns true. For Xattr, this always returns true.

    if ($writer->allowed_fields())
    {
	....
    }

known_fields

Returns the fields which this writer knows about. This writer has no limitations.

my $known_fields = $writer->known_fields();

readonly_fields

Returns the fields which this writer knows about, which can't be overwritten, but are allowed to be "wanted" fields. Things like file-size etc.

my $readonly_fields = $writer->readonly_fields();

delete_field_from_file

Completely remove the given field. For multi-value fields, it removes ALL the values.

$writer->delete_field_from_file(filename=>$filename,field=>$field);

replace_all_meta

Overwrite the existing meta-data with that given.

(This supercedes the parent method because we can do it more efficiently this way)

$writer->replace_all_meta(filename=>$filename,meta=>\%meta);

Helper Functions

Private interface.

replace_one_field

Overwrite the given field. This does no checking for multi-value fields.

$writer->replace_one_field(filename=>$filename,field=>$field,value=>$value);

BUGS

Please report any bugs or feature requests to the author.