<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1.2//EN"
  "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">


<refentry id="gfxattr.1">

<refentryinfo><date>18 Aug 2008</date></refentryinfo>

<refmeta>
<refentrytitle>gfxattr</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo>Gfarm</refmiscinfo>
</refmeta>

<refnamediv id="name">
<refname>gfxattr</refname>
<refpurpose>Manipulate extended attributes in Gfarm file system</refpurpose>
</refnamediv>

<refsynopsisdiv id="synopsis">
<cmdsynopsis sepchar=" ">
  <command moreinfo="none">gfxattr</command>
    <group choice="opt" rep="norepeat">
      <arg choice="plain" rep="norepeat">-s</arg>
      <arg choice="plain" rep="norepeat">-g</arg>
      <arg choice="plain" rep="norepeat">-l</arg>
      <arg choice="plain" rep="norepeat">-r</arg>
    </group>
    <arg choice="opt" rep="norepeat">-x</arg>
    <group choice="opt" rep="norepeat">
      <arg choice="plain" rep="norepeat">-c</arg>
      <arg choice="plain" rep="norepeat">-m</arg>
    </group>
    <arg choice="opt" rep="norepeat">-f <replaceable>xattrfile</replaceable></arg>
    <arg choice="plain" rep="norepeat"><replaceable>file</replaceable></arg>
    <arg choice="opt" rep="norepeat"><replaceable>xattrname</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<!-- body begins here -->

<refsect1 id="description"><title>DESCRIPTION</title>

<para>
gfxattr manipulates extended attributes and XML extended attributes of
a specified file.  An extended attribute consists of an attribute name
and an attribute value, which are arbitrary strings.  An XML extended
attribute is an extended attribute having an XML attribute value.
Since XML extended attributes have a different name space from
extended attributes, the same attribute name can be used.
</para>

<para>
When the -x option is specified, XML extended attributes are
manipulated.  It is possible to search XML extended attributes by
XPath query using gffindxmlattr command.
</para>

<para>
All files and directories in Gfarm file system can keep extended
attributes.  When removing a file or directory, the associated
extended attributes are also removed.
</para>

<para>
Either -s, -g, -l, or -r option should be specified.
</para>

</refsect1>

<refsect1 id="options"><title>OPTIONS</title>
<variablelist>
<varlistentry>
<term><option>-s</option></term>
<listitem>
<para>
sets a new value with an extended attribute xattrname for a specified
file.  With the -f option, the value can be specified by the file
xattrfile instead of by the standard input.  When neither -c nor -m
option is specified, the extended attribute is overwritten if it is
already set.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-g</option></term>
<listitem>
<para>reads a value with an extended attribute xattrname for a
specified file.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-l</option></term>
<listitem>
<para>display a list of extended attributes for a specified
file.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-r</option></term>
<listitem>
<para>removes a extended attribute xattrname for a specified
file.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-x</option></term>
<listitem>
<para>manipulates XML extended attributes.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-c</option></term>
<listitem>
<para>sets a new extended attribute if it is not set.  This option is
used with the -s option.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-m</option></term>
<listitem>
<para>modifies the extended attribute if there it is.  This option is
used with the -s option.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-f</option> xattrfile</term>
<listitem>
<para>
With the -s option, reads an extended attribute from the specified
xattrfile instead of from the standard input.  With the -g option,
writes the extended attribute to the specified xattrfile instead of to
the standard output.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-?</option></term>
<listitem>
<para>displays usage.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 id="see-also"><title>SEE ALSO</title>
<para>
  <citerefentry>
  <refentrytitle>gffindxmlattr</refentrytitle><manvolnum>1</manvolnum>
  </citerefentry>
</para>
</refsect1>

</refentry>
