Wednesday, November 11, 2009

Remove Extended attributes present in file permission in Mac OS

Hi Guys,

For the past two days I was struggling to get rid of the '@' character which is appended in the permission for a file whenever used using the TextMate Editor in the Mac OS. I opened TextMate Editor and created a file called "test.txt" which is created successfully but unfortunately the permissions saved are


-rw-r--r--@ 1 kishorekumar admin 5 Nov 11 13:56 test.txt


Now I felt strange regarding this why this @ came and what is that exactly. Later after two days of digging I found the answer and now I am relaxed. Oops sorry to continue my story.. continuing back..

What I understood regarding the '@' is that it is file extended attributes for the Mac files. You can see them with the -@ flag to ls, or with the new xattr command:


ls -al test.txt
-rw-r--r--@ 1 kishorekumar admin 5 Nov 11 13:56 test.txt



ls -al@ test.txt
-rwxr-xr-x@ 1 kishorekumar admin 11614 Nov 11 12:27 test.txt
com.macromates.caret 35



xattr -l test.txt
com.apple.FinderInfo:
0000 00 00 00 00 54 78 4D 74 00 00 00 00 00 00 00 00 ....TxMt........
0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

com.macromates.caret: {
column = 7;
line = 295;
}


So now, how to get rid of the '@' and the com.apple.FinderInfo & com.macromates.caret so here is the simple and fastest solution which works faster.

To Disable the Extra Attributes which gets attached to the file is just run this below command in the Terminal.

defaults write com.macromates.textmate OakDocumentDisableFSMetaData 1


To Enable the Extra Attributes which gets attached to the file is just run this below command in the Terminal.

defaults write com.macromates.textmate OakDocumentDisableFSMetaData 0


Note: Make sure that you restart the TextMate Application else it might not work perfectly.

Hope this might help you easily. If not please let me know I will try to help you :-)

3 comments:

  1. I found the same problem but my program was Adobe CS4 PhotoShop, and I couldn't find the application name that you used for textmate for Photoshop, any suggestions?

    ReplyDelete
  2. @Adesso, hope you are working on Mac OS, also which Application name you are trying to find.

    ReplyDelete
  3. this @ character was annoying me as well. now, it works fine after disabling it via command line.

    thanks :)

    ReplyDelete