Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I achieve the equivalent of setfile -type 'sbDB' ~/myfile on OS X 10.7, which no longer seems to support the setfile command?

I happen to know that the equivalent of setfile -a V ~/myfile is now chflags hidden ~/myfile. But how do I do I set a custom type like for instance sbDB - when I try chflags sbDB ~/myfile it says "invalid flag".

share|improve this question
What is the expected outcome of the 'setfile' command? When I run it on an empty file with no extension (created via touch) there is no output, but Finder shows the file as a 'Sidebar DropBox folder icon" which makes me think that setfile is working on Lion (10.7.1) for me. – TJ Luoma Sep 28 '11 at 4:18
@TJ, it doesn't for me - i simply get -bash: setfile: command not found – 0sh Sep 29 '11 at 19:04
up vote 1 down vote accepted

Install Xcode.

I am (99.999%) sure that SetFile is part of that (I wish it wasn't).

share|improve this answer
I'll accept this answer, but I believe there should be a way around this, without having to install Xcode. – 0sh Nov 1 '11 at 17:51

You can just download the latest CLI tools for XCode here. Select the package for your OS X version. I just downloaded the November Mountain Lion XCode tools, and app setflag is included.

share|improve this answer

Just to freshen up the information here, having just grappled with this: As of OS X 10.8.2 SetFile is still no longer included in a regular base install (to the best of my knowledge). I have read that as of 10.4.X it could have been found under /Library/Receipts.
Source: MacRumors

It also now seems that xcode no longer installs its resources into the root directory /Developer/ but instead keeps all its resources within itself, i.e. with in the package contents (right-click → Show Package Contents). I can't give the path at the moment as I'm not on a 10.8 box, but it didn't take me long to find it once I was in there.

If there is a method that supersedes SetFile which doesn't require dependances outside of a base install, I'd sure like to know about it!

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .