Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8880509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:10:44+00:00 2026-06-14T20:10:44+00:00

I’m trying to copy extended attributes from one file to another using the OSX

  • 0

I’m trying to copy extended attributes from one file to another using the OSX “xattr” utility. The background is that we are building a backup tool and the files/structure must retain all attributes, ACLs, etc… Everything is working fine except large attributes like resource forks. Small attributes work fine using method below. Attempting this on OS X 10.7.5 Here is what I am doing:

First I identify the attributes on a file using “ls -l@”. Result below:

-rwxrwxrwx@ 1 testuser  staff        0  3 Jan  2011 File
        com.apple.FinderInfo         32 
        com.apple.ResourceFork   237246 

Now I export the attribute (com.apple.ResourceFork is the one causing issues):

xattr -px com.apple.ResourceFork File > attribfile

I now want to apply this attribute to the copy of the file on another mac using this command:

xattr -wx com.apple.ResourceFork "`cat attribfile`" File 

This results in:

-bash: /usr/bin/xattr: Argument list too long

I think I know why it is happening… the resource fork data is way too long to fit in an argument. I have not established the threshold at which it starts to break but I suspect it has to do with ARG_MAX. xargs doesn’t help here since it is not several smaller arguments, but one very large one.

So multiple questions:

  1. Is there a way to make xattr accept this large value? Somehow pipe it in via standard input? man page does not show it, but I am not an expert and maybe there is some creative way to do it
  2. Can anyone tell me the proper way to apply a large extended attribute using stock command line tools?
  3. if there is no stock command line tools, any recommendations for 3rd party tools?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:10:45+00:00Added an answer on June 14, 2026 at 8:10 pm

    I don’t know of a way to do it with xattr, but there’s an old filesystem trick you can use. Note: this is basically obsolete, but still works in 10.8.2; I make no promises about 10.8.3 etc. If the attribfile is in hex format, use this:

    xxd -r -p attribfile >File/..namedfork/rsrc
    

    If the attribfile is raw, use cat instead of xxd -r -p. If the attribute is something other than the resource fork, … I have no idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.