Source of: /manual/en/function.xattr-remove.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.xattr.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'function.xattr-remove.php',
1 => 'xattr_remove',
),
'up' =>
array (
0 => 'ref.xattr.php',
1 => 'xattr Functions',
),
'prev' =>
array (
0 => 'function.xattr-list.php',
1 => 'xattr_list',
),
'next' =>
array (
0 => 'function.xattr-set.php',
1 => 'xattr_set',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.xattr-remove" class="refentry">
<div class="refnamediv">
<h1 class="refname">xattr_remove</h1>
<p class="verinfo">(PECL xattr >= 0.9.0)</p><p class="refpurpose"><span class="refname">xattr_remove</span> — <span class="dc-title">
Remove an extended attribute
</span></p>
</div>
<a name="function.xattr-remove.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><b>xattr_remove</b></span>
( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$filename</tt></span>
, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$name</tt></span>
[, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$flags</tt><span class="initializer"> = 0</span></span>
] )</div>
<p class="para rdfs-comment">
This function removes an extended attribute of a file.
</p>
<p class="para">Extended attributes have two different namespaces: user
and root. The user namespace is available to all users, while the root namespace
is available only to users with root privileges. xattr operates on the user
namespace by default, but this can be changed with the
<i><tt class="parameter">flags</tt></i>
parameter.</p>
</div>
<a name="function.xattr-remove.parameters"></a><div class="refsect1 parameters">
<h3 class="title">Parameters</h3>
<p class="para">
</p><dl>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">filename</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The file from which we remove the attribute.
</p>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">name</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The name of the attribute to remove.
</p>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">flags</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
</p><table class="doctable table">
<caption><b>Supported xattr flags</b></caption>
<tbody valign="middle" class="tbody">
<tr valign="middle">
<td align="left"><b><tt class="constant">XATTR_DONTFOLLOW</tt></b></td>
<td align="left">Do not follow the symbolic link but operate on symbolic link itself.</td>
</tr>
<tr valign="middle">
<td align="left"><b><tt class="constant">XATTR_ROOT</tt></b></td>
<td align="left">Set attribute in root (trusted) namespace. Requires root privileges.</td>
</tr>
</tbody>
</table>
<p>
</p>
</dd>
</dl>
<p>
</p>
</div>
<a name="function.xattr-remove.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
Returns <b><tt class="constant">TRUE</tt></b> on success or <b><tt class="constant">FALSE</tt></b> on failure.
</p>
</div>
<a name="function.xattr-remove.examples"></a><div class="refsect1 examples">
<h3 class="title">Examples</h3>
<p class="para">
</p><div class="example">
<p><b>Example #1 Removes all extended attributes of a file</b></p>
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB"><?php<br />$file </span><span style="color: #007700">= </span><span style="color: #DD0000">'some_file'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$attributes </span><span style="color: #007700">= </span><span style="color: #0000BB">xattr_list</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">);<br /><br />foreach (</span><span style="color: #0000BB">$attributes </span><span style="color: #007700">as </span><span style="color: #0000BB">$attr_name</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">xattr_remove</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">, </span><span style="color: #0000BB">$attr_name</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?></span>
</span>
</code></div>
</div>
</div><p>
</p>
</div>
<a name="function.xattr-remove.seealso"></a><div class="refsect1 seealso">
<h3 class="title">See Also</h3>
<p class="para">
</p><ul class="simplelist">
<li class="member"><a href="function.xattr-list.php" class="function" rel="rdfs-seeAlso">xattr_list()</a> - Get a list of extended attributes</li>
<li class="member"><a href="function.xattr-set.php" class="function" rel="rdfs-seeAlso">xattr_set()</a> - Set an extended attribute</li>
<li class="member"><a href="function.xattr-get.php" class="function" rel="rdfs-seeAlso">xattr_get()</a> - Get an extended attribute</li>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>