[Box Backup] OS X xattr backups

Eric Cronin boxbackup@fluffy.co.uk
Thu, 19 Jun 2008 14:26:17 -0400


This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--Apple-Mail-1--630423687
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit


On Jun 19, 2008, at 12:30 PM, Chris Wilson wrote:

>
> Yes, that's right. I'm glad it works for you. I'm still not sure  
> that 10k
> is a reasonable buffer size though, or exactly what to do if it's  
> not big
> enough. The API for (l)listxattr sucks. :-(


Does the buffer size need to be static?  The OS X implementation at  
least has the ability to return the size needed:

      If namebuf is set to NULL, the function returns the size of the  
list of
      extended attribute names.  This facility can be used to  
determine the
      size of a buffer sufficiently large to hold the names of the  
attributes
      currently associated with path.

Since you dynamically allocate the string already, setting  
listBufferSize with a pre-call to listxattr() seems simple enough.

Thanks,
Eric

--Apple-Mail-1--630423687
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iQEcBAEBCAAGBQJIWqTJAAoJEIgz4Q+coYsSBR0H/0O7ovcaorZF+J3HW3olIJ9B
BSnbMX+jLS41h8acuvK3TZKr4bCbuNa7wg3cIl3wrsmQ2OF9CQmJL4DL8fEkD4ft
Tj7nn6A2oCMgu4VJvBimSSxtA14Fs3HOj1cLePjgD16UiOYj+atSSN2QhHE4dMWQ
zRh7fttYpcxFsido6NWCRh613wpG35Skn7g+tmEM98KKiy+vpYng4D7U9ojepjiL
9LgJSuqYXAMg7NM2+xz4UdVRTVGHQlCMwItZNz1QNnvV7iMgQ/cmaISpn7/ftd/L
R5c+5kfeVHzsydYe9JzFITCw9gNjzkjlCFx3vEA0IRuSmbo0v1Rv3vFEJPUHPpM=
=lzFY
-----END PGP SIGNATURE-----

--Apple-Mail-1--630423687--