[clug] Anyone using extended attributes? esp for hashsums

Paul Wayper paulway at mabula.net
Tue Nov 26 03:44:54 MST 2013

Hash: SHA1

On 26/11/13 09:24, steve jenkin wrote:
> There was a recent post where someone mentioned they used extended 
> attributes.
> Does anyone use xattr's to keep hashsums (and the time they were 
> computed)? Faster to read an MD5/SHA1 than to recompute when selecting 
> files for backup etc.
> Any "war stories", 'gotchas' and 'this will trip you up' would be 
> appreciated. [saw something about an effective 4KiB limit]
> I did a small amount of research on what attribute names to use and 
> didn't end up finding out much.

In CFile, I use extended attributes to store the uncompressed size of a
bzip2 file because computing its size is costly.  I store the size as a
32-bit off_t and the time stamp as a time_t; that's open to improvement.

So I suspect that what I'm storing is much smaller than your information.

It seems to me, though, that checking the checksum stored in an xattr with a
timestamp is no better than just checking the timestamp.  You'll only know
if the file's changed because the timestamp's different, and you're only
interested in the checksum to know if the file's changed.  What have I
missed in your thinking?

Have fun,

Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/


More information about the linux mailing list