<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: xattr - Python extended filesystem attributes</title>
	<atom:link href="http://bob.pythonmac.org/archives/2005/10/08/xattr-python-extended-filesystem-attributes/feed/" rel="self" type="application/rss+xml" />
	<link>http://bob.pythonmac.org/archives/2005/10/08/xattr-python-extended-filesystem-attributes/</link>
	<description>Bob's Rants</description>
	<pubDate>Thu, 24 Jul 2008 01:14:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: bob</title>
		<link>http://bob.pythonmac.org/archives/2005/10/08/xattr-python-extended-filesystem-attributes/#comment-9156</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Wed, 28 Mar 2007 18:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/archives/2005/10/08/xattr-python-extended-filesystem-attributes/#comment-9156</guid>
		<description>I don't know nor care which Linux filesystems support extended attributes... I would imagine ext3 has them. I don't use Linux with any regularity.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know nor care which Linux filesystems support extended attributes&#8230; I would imagine ext3 has them. I don&#8217;t use Linux with any regularity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don Park</title>
		<link>http://bob.pythonmac.org/archives/2005/10/08/xattr-python-extended-filesystem-attributes/#comment-9155</link>
		<dc:creator>Don Park</dc:creator>
		<pubDate>Wed, 28 Mar 2007 16:55:45 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/archives/2005/10/08/xattr-python-extended-filesystem-attributes/#comment-9155</guid>
		<description>i found this page while looking at the requirements for apple's calendar server. from http://trac.macosforge.org/projects/calendarserver/wiki/Portability: "File system extended attributes are available on all file systems in Mac OS X, and on some file systems on Linux and FreeBSD."

I was hoping to find a list of filesystems under linux which a) have extended attributes and b) are supported by xattr. I could not find such info on the xattr home page. Could this information be added?</description>
		<content:encoded><![CDATA[<p>i found this page while looking at the requirements for apple&#8217;s calendar server. from <a href="http://trac.macosforge.org/projects/calendarserver/wiki/Portability" rel="nofollow">http://trac.macosforge.org/projects/calendarserver/wiki/Portability</a>: &#8220;File system extended attributes are available on all file systems in Mac OS X, and on some file systems on Linux and FreeBSD.&#8221;</p>
<p>I was hoping to find a list of filesystems under linux which a) have extended attributes and b) are supported by xattr. I could not find such info on the xattr home page. Could this information be added?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joseph Rawson</title>
		<link>http://bob.pythonmac.org/archives/2005/10/08/xattr-python-extended-filesystem-attributes/#comment-4000</link>
		<dc:creator>Joseph Rawson</dc:creator>
		<pubDate>Mon, 04 Dec 2006 21:05:52 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/archives/2005/10/08/xattr-python-extended-filesystem-attributes/#comment-4000</guid>
		<description>I made a small script that helps me with making cd's and dvd's.  I always try to put md5sums on the dvd's I make.  Using the xattr keeps me from having to do the same thing more that once.  You may place this as an example, since there are none in the package.  It's public domain.  I call it generate-md5sums


Here it is.
----------------------------------------
&lt;code&gt;&lt;pre&gt;
#!/usr/bin/python
import os,sys
import os.path
from md5 import md5
from xattr import xattr
from optparse import OptionParser

# you may want to set these variables
BLOCK_SIZE = 1024
attribute_name = 'user.md5sum'
MD5SUMS_FILENAME = 'md5sums.txt'

# there is no use for the option parser now
parser = OptionParser()

opts, args = parser.parse_args(sys.argv[1:])

def md5sum(afile):
    """returns the standard md5sum hexdigest
    for a file object"""
    m = md5()
    block = afile.read(BLOCK_SIZE)
    while block:
        m.update(block)
        block = afile.read(BLOCK_SIZE)
    return m.hexdigest()

def append_md5sum(mainfile, filename, md5digest):
    mainfile.write('%s  %s\n' % (md5digest, filename))
    

if len(args) == 0:
    top = '.'
else:
    print "can't handle arguments right now"
    sys.exit(1)
    
main_md5sums_filename = os.path.join(top, MD5SUMS_FILENAME)
main_md5sums = file(main_md5sums_filename, 'w')

for root, dirs, files in os.walk(top, topdown=False):
    for name in files:
        filename = os.path.join(root, name)
        if filename != main_md5sums_filename:
            xf = xattr(filename)
            if xf.has_key(attribute_name):
                md = xf.get(attribute_name)
            else:
                md = md5sum(file(filename))
                xf.set(attribute_name, md)
            append_md5sum(main_md5sums, filename, md)
main_md5sums.close()
&lt;/pre&gt;&lt;/code&gt;
------------------------------------

btw, thanks for making my life a little easier now. :)</description>
		<content:encoded><![CDATA[<p>I made a small script that helps me with making cd&#8217;s and dvd&#8217;s.  I always try to put md5sums on the dvd&#8217;s I make.  Using the xattr keeps me from having to do the same thing more that once.  You may place this as an example, since there are none in the package.  It&#8217;s public domain.  I call it generate-md5sums</p>
<p>Here it is.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<code>
<pre>
#!/usr/bin/python
import os,sys
import os.path
from md5 import md5
from xattr import xattr
from optparse import OptionParser

# you may want to set these variables
BLOCK_SIZE = 1024
attribute_name = 'user.md5sum'
MD5SUMS_FILENAME = 'md5sums.txt'

# there is no use for the option parser now
parser = OptionParser()

opts, args = parser.parse_args(sys.argv[1:])

def md5sum(afile):
    &#8220;&#8221;"returns the standard md5sum hexdigest
    for a file object&#8221;"&#8221;
    m = md5()
    block = afile.read(BLOCK_SIZE)
    while block:
        m.update(block)
        block = afile.read(BLOCK_SIZE)
    return m.hexdigest()

def append_md5sum(mainfile, filename, md5digest):
    mainfile.write(&#8217;%s  %s\n&#8217; % (md5digest, filename))

if len(args) == 0:
    top = &#8216;.&#8217;
else:
    print &#8220;can&#8217;t handle arguments right now&#8221;
    sys.exit(1)

main_md5sums_filename = os.path.join(top, MD5SUMS_FILENAME)
main_md5sums = file(main_md5sums_filename, &#8216;w&#8217;)

for root, dirs, files in os.walk(top, topdown=False):
    for name in files:
        filename = os.path.join(root, name)
        if filename != main_md5sums_filename:
            xf = xattr(filename)
            if xf.has_key(attribute_name):
                md = xf.get(attribute_name)
            else:
                md = md5sum(file(filename))
                xf.set(attribute_name, md)
            append_md5sum(main_md5sums, filename, md)
main_md5sums.close()
</pre>
<p></code><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>btw, thanks for making my life a little easier now. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Ray</title>
		<link>http://bob.pythonmac.org/archives/2005/10/08/xattr-python-extended-filesystem-attributes/#comment-2675</link>
		<dc:creator>Brian Ray</dc:creator>
		<pubDate>Sun, 30 Oct 2005 00:09:04 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/archives/2005/10/08/xattr-python-extended-filesystem-attributes/#comment-2675</guid>
		<description>Nice! 

I am not all that found of resource forks, so I am happy to see xattr. And real happy to see this module.

On OSX, I did notice the enforcement of the 4K value limits with:

   IOError: [Errno 7] Argument list too long

But when I make the key longer than 128 bytes the error is not as descriptive:

   IOError: [Errno 1] Operation not permitted

I wish this was more descriptive, but probably Apples fault?

Regards</description>
		<content:encoded><![CDATA[<p>Nice! </p>
<p>I am not all that found of resource forks, so I am happy to see xattr. And real happy to see this module.</p>
<p>On OSX, I did notice the enforcement of the 4K value limits with:</p>
<p>   IOError: [Errno 7] Argument list too long</p>
<p>But when I make the key longer than 128 bytes the error is not as descriptive:</p>
<p>   IOError: [Errno 1] Operation not permitted</p>
<p>I wish this was more descriptive, but probably Apples fault?</p>
<p>Regards</p>
]]></content:encoded>
	</item>
</channel>
</rss>
