The mysteries of the XATTR_SHOWCOMPRESSION option
The mysteries of the XATTR_SHOWCOMPRESSION option
- Subject: The mysteries of the XATTR_SHOWCOMPRESSION option
- From: James Bucanek <email@hidden>
- Date: Wed, 22 Feb 2012 09:16:22 -0700
Greetings,
This question is in the context of a backup application, so I'm
concerned with backing up and restoring extended attributes on a filesystem.
Should I be concerned with the XATTR_SHOWCOMPRESSION option to
the listxattrs() and getxattr() functions?
The documentation says:
XATTR_SHOWCOMPRESSION
getxattr() and fgetxattr() will return HFS Plus Compression
extended attribute name (if
present) for the file referred to by path or fd.
I'd like to know what these special xattrs are and how they
should be handled (i.e., when restoring should these xattrs be
set before the data forks are written, etc.).
I thought I would see what files had them, but I can't find any. :(
As a test, I wrote the following loop and ran it as root on
every file of a relatively recent Lion install.
int i;
for (i=1; i<argc; i++)
{
ssize_t nameListLength, altListLength;
// Get the size of the extended attributes name list
nameListLength = listxattr(argv[i],NULL,sizeof(names),XATTR_NOFOLLOW);
if (nameListLength<0)
{
NSLog(@"%s; errno=%d",argv[i],(int)errno);
continue;
}
if (nameListLength==0)
{
//NSLog(@"%s; no extended attributes",argv[i]);
continue;
}
altListLength = listxattr(argv[i],NULL,sizeof(names),XATTR_NOFOLLOW|XATTR_SHOWCOMPRESSION);
if (nameListLength!=altListLength)
{
NSLog( ... print out all xattrs ... );
}
}
The results were ... nothing. Not a single file on the volume
returned a different set of xattr names when the
XATTR_SHOWCOMPRESSION option was included.
--
James Bucanek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden