Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I open a file info, and change the application responsible for that file, where is this override stored on the system?

share|improve this question

2 Answers 2

The data is stored in the resource fork of the file, which is stored as the extended attribute com.apple.ResourceFork.

Take the following as an example -

Using Terminal, create a test file, calling it "test.txt"

System:~ user$ touch test.txt

By default "txt" extension files are opened with TextEdit. (Unless you've modified the system-wide default.) In the Finder, change the association to something else. Go back to the Terminal ..

 System:~ user$ ls -l@ test.txt

 -rw-r--r--@ 1 user  staff  0 Sep 29 11:21 test.txt
         com.apple.ResourceFork 1338

The @ symbol denotes the file has extended attributes, and ls -l@ lists the attributes as part of the long format.

If you have the Developer Tools installed, you can use DeRez to inspect the resource fork, and you'll see the path of the application you selected in the fork.

It's archaic, deprecated, and could (rightly) be called a hack ... but given that the UTI and bundle identifier system is "incomplete", it's what Apple uses.

share|improve this answer
    
Where's @ documented? Current (10.7.4) OS X Darwin ls supports the following options. ls -ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1 –  Slomojo Jul 3 '12 at 2:15
    
@slomojo - According to Apple's online man page for ls for 10.7.4, @ is still accepted. –  JasKerr Jul 5 '12 at 14:41
    
Thanks, seem they just overlooked it on the quick opt list, and I happened to try it out on a folder containing only files that didn't have res-forks. - It's working (no surprise) in ML 10.8 too. –  Slomojo Jul 5 '12 at 15:57

I'm not sure about Mac OS X, but Mac OS (i.e. Classic) used to store this in the resource fork of each file with two pieces of information: the type code and the creator code. Both were four-byte sequences and were thus usually rendered as four character strings. The type code identified the type of the file (e.g. TEXT for a text file, APPL for an application), while the creator code identifies the application that created the file (e.g. ttxt for SimpleText or MSWD for Microsoft Word). Thus a file created by SimpleText would open in SimpleText by default, while still being identified as a text file and therefore compatible with Microsoft Word, should you choose to manually open it with Word.

Snow Leopard no longer pays any attention to type and creator codes, having replaced them with UTIs, which are reminiscent of MIME types, although more flexible, and can be used to specify the default program as well as determining which programs are compatible with a given file, but I'm not sure how individual overrides are done.

share|improve this answer
1  
Changes are stored in ~/Library/Preferences/com.apple.LaunchServices.plist Mac OS X also stores more information in /Library/Preferences/.GlobalPreferences.plist & ~/Library/Preferences/.GlobalPreferences.plist & ~/Library/Preferences/ByHost/.GlobalPreferences.plist However, I was unable to locate where the global overrides are stored. –  Madison S Sep 29 '10 at 15:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.