Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 04-18-2009, 06:01 PM   #1
telarmago
Prospect
 
Join Date: Apr 2009
Posts: 3
Removing extended attributes in 10.5

I'm trying to remove the metadata that specifies where a file was downloaded from. I've searched high and low, but nothing has worked. The code at http://zzamboni.org/brt/2008/05/07/r...irectory-tree/ does not work for me, the extended attributes still remain. I've looked at xattr -h, but I don't know what attr_name are available, let alone what the attr_name to remove where I downloaded something from is.

Ideally, I'd like to remove all metadata from my files (aside from mp3 tags) in 10.5 - this was never a problem in Windows (which I STILL need to manage mp3 tags as OSX lacks any comprehensive tag manager)

Thanks for reading
telarmago is offline   Reply With Quote
Old 04-19-2009, 12:34 AM   #2
Hal Itosis
Hall of Famer
 
Join Date: Apr 2002
Posts: 3,315
If you list the item using just xattr (or ls -l@) the attribute names appear:
E.g., com.apple.metadata:kMDItemWhereFroms

So use that name with the -d option (to delete it):
xattr -d "com.apple.metadata:kMDItemWhereFroms" /path/to/the/file

You'd need to repeat that for each attribute, such as "com.apple.quarantine" [hence the script you linked to]
--
One way to strip all xattrs simultaneously is to copy the file (or folder full of files) in a certain way.
E.g., use cp with the -X option... or rsync without the -E option.]

Last edited by Hal Itosis; 04-19-2009 at 12:45 AM.
Hal Itosis is offline   Reply With Quote
Old 04-21-2009, 04:20 PM   #3
telarmago
Prospect
 
Join Date: Apr 2009
Posts: 3
Thanks for the response
telarmago is offline   Reply With Quote
Old 04-23-2009, 05:00 PM   #4
telarmago
Prospect
 
Join Date: Apr 2009
Posts: 3
I've successfully used:

sudo xattr -d "com.apple.metadata:kMDItemWhereFroms" "/Volumes/Storage/Media/Videos/Filename.avi"

How would I go about scripting this to run on all files in a directory? I have many many gigs of files, so I'd rather not have to copy them.

Also, I've noticed while backing up these files to a FAT32 external drive, the info on where the file was downloaded from is gone. Does copying these files to a FAT32 drive also remove the extended attributes, or are they just not showing up due to the drive being FAT32?

Last edited by telarmago; 04-23-2009 at 05:03 PM.
telarmago is offline   Reply With Quote
Old 04-24-2009, 03:58 AM   #5
ganbustein
MVP
 
Join Date: Apr 2008
Location: Berkeley CA USA
Posts: 1,176
Quote:
Originally Posted by telarmago
Also, I've noticed while backing up these files to a FAT32 external drive, the info on where the file was downloaded from is gone. Does copying these files to a FAT32 drive also remove the extended attributes, or are they just not showing up due to the drive being FAT32?

My guess would be that FAT32 simply doesn't support the extended attributes, so they're gone. I don't have any FAT32 volumes to test with, but you can test quite easily. Just copy one of the files back to HFS+ and see if the extended attributes survive the round trip.
ganbustein is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 12:34 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.