File (Class)

In:

Public Class methods

Returns a hash with all attributes and their values

    File.get_all_attrs(".") => ("mime" => "text/plain", "rating" => "4")

Returns the value of the attribute attribute

    File.get_attr(".", "description") => "ruby-xattr directory and files"

Returns an array with all attributes

    File.list_attrs(".") => ("type", "rating", "artist")

Removes attribute from the given file

    File.remove_attr(".", "description")

Sets the attribute attribute for the file filename

    File.set_attr("test.rb", "description", "test script") # => "test script"

Public Instance methods

Returns a hash with all attributes and their values

    File.new(__FILE__).get_all_attrs() => ("type" => "jpeg", "rat" => "4")

Returns the value of attribute for the file

    File.new(__FILE__).get_attr("description") # => "test script"

Returns an array with all attributes

    File.new(__FILE__).list_attrs() => ("type", "rating", "artist")

Removes attribute from the file

    File.new(__FILE__).remove_attr("description")

Sets the attribute attribute for the file.

    File.new("test.rb").set_attr("description", "test script") # => "test script"

[Validate]