Parent: [15c2a8] (diff)

Download this file

index.html    81 lines (80 with data), 7.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>pxattr: pxattr: portable extended attributes C++ programming interface</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">pxattr
&#160;<span id="projectnumber">2.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">pxattr: portable extended attributes C++ programming interface </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><dl class="section author"><dt>Authors</dt><dd>Jean-Francois Dockes <a href="#" onclick="location.href='mai'+'lto:'+'jfd'+'@r'+'eco'+'ll'+'.or'+'g'; return false;">jfd@r<span style="display: none;">.nosp@m.</span>ecol<span style="display: none;">.nosp@m.</span>l.org</a></dd></dl>
<h1><a class="anchor" id="intro"></a>
Introduction</h1>
<p>Extended attributes are arbitrarily named pieces of data associated with a file and managed by the file system.</p>
<p>The names and the values for the attributes are freely chosen by applications and/or users, with very few restrictions. Many recent systems and filesystems support extended attributes, but the interfaces used to manage them are far from identical.</p>
<p>Linux, FreeBSD and Mac OS X all provide similar extended attributes functionality.</p>
<h1><a class="anchor" id="pxattr"></a>
Pxattr</h1>
<p>The pxattr package provides a portable programming interface for managing file extended attributes on all three systems. It consists in a single C++ module (one source and one include file), which is to be included in the application source code (being too trivial to justify a library).</p>
<p>Calls are provided to read, modify or delete extended attributes. Check the Namespaces above for more detail.</p>
<p>Linux note: on Linux, user attributes are distinguished by having a "user." prefix in their name. On Mac OS X and FreeBSD, the user and other name spaces are distinguished by argument to the library calls. pxattr hides the "user." prefix on Linux, so that you should not specify it when reading or setting a value.</p>
<dl class="section user"><dt>Command line program</dt><dd></dd></dl>
<p>The C++ file can also be compiled into program which provides a handy way to manage attributes from the command line.</p>
<p>Especially, the <em>pxattr</em> command can produce a dump of the extended attributes for a directory tree. This dump can then be restored if the tree has been copied elsewhere. This works across the three platforms and can provide a workaround for the current lack of common extended attributes archiving commands. Method: </p>
<pre class="fragment">cd /just/above/my/treedir/..
pxattr -lR treedir &gt; treedir/extattr_archive.txt # or whatever...
tar cf /tmp/myarchive.tar treedir
</pre><p>On the target: </p>
<pre class="fragment">tar xf myarchive.tar
pxattr -S treedir/extattr_archive.txt
</pre><p>Notice that I took care to preserve the relative paths when doing the backup and the restore. In a pinch, the dump could be edited to fix the paths (use sed or emacs), the dump format is line-oriented but as binary as the extended attributes contents, with just a few escaped characters.</p>
<dl class="section user"><dt>license</dt><dd>pxattr is free software, with an MIT-type license, use and redistribute freely.</dd></dl>
<dl class="section user"><dt>Download pxattr </dt><dd><a href="pxattr-2.1.0.tar.gz">pxattr-2.1.0.tar.gz</a></dd></dl>
<dl class="section user"><dt>Source repository</dt><dd><a href="https://bitbucket.org/medoc/pxattr">On BitBucket</a></dd></dl>
<dl class="section user"><dt>Building the driver</dt><dd>You will need g++ and make (and nothing else as far as I know). Typing "make" inside the source directory should then be enough.</dd></dl>
<dl class="section user"><dt>Note</dt><dd>The previous version of the library had a bug which had it adding the "user." prefix to names on other platforms. This was not a main issue inside pxattr, but posed a compatibility problem when using raw system utilities or moving files between systems. Version 2.0 fixes this problem but the change means that it is incompatible with attributes created by pxattr 1.0 (which contain the "user." prefix, which will appear when listing the attributes and now need to be added when fetching a value. You can use "make CXXFLAGS=-DCOMPAT1 to force the 1.0 behaviour with 2.0. This does not make a lot of sense though, because you're just as well staying with 1.0 then, as nothing else has changed.</dd></dl>
<dl class="section user"><dt>Licensing</dt><dd>Copyright (c) 2009-2013 Jean-Francois Dockes </dd></dl>
<dl class="section user"><dt></dt><dd>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: </dd></dl>
<dl class="section user"><dt></dt><dd>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. </dd></dl>
<dl class="section user"><dt></dt><dd>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </dd></dl>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Feb 4 2013 14:20:24 for pxattr by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>