From: Chris Gehlker Date: 2002-06-03T07:21:03+09:00 Subject: Re: Finding all applications On 6/2/02 7:29 AM, "Sean Russell" wrote: > Chris Gehlker wrote: > I want to caveat my earlier message about slocate. It does build this > index, but it is particular to Linux installations. I mean, I'm sure that > you could easily compile and install it on any *n*x-ish OS, but you won't > find it there commonly, so it probably won't be of any use to you. Thanks for all the suggestions, Sean. Mac OS does provide BSD locate but it's broken. The problem is that crontabs is set up by default to update the data base at some weird time like 1:00 am on Monday mornings. Power management is set up to have the Mac asleep then. So the cron task never actually runs. I bet 80% of the Mac users never notice this because they have Sherlock right in the dock so they don't investigate locate. > A further speedbump: > > All of this talk about i-nodes and filesystems illustrates the fact that > there isn't a portable way to do what you want, because there are at least > three /commonly/ used filesystems on Linux, another three for the rest of > the Unix world, and probably yet another three for the other common OSes. > This isn't counting network FSes. I agree. I really don't need it to be portable though. >> Basically yes. There is API for treating the filesystem as a database. >> Sherlock exposes this API to the user but any app can use it as well. > > And OS/X doesn't provide a command-line interface to this API? I don't think so. I stumbled over a few command line tools that aren't in the man pages anywhere but I searched the documentation and couldn't find anything like this. > By the way, I'm curious: I was a long-time NeXTSTEP user. Under NeXTSTEP, > 'find / -name \*.app' wouldn't do what you wanted it to. Not all > applications under NeXT were packaged as 'app's; for example, you'd miss > all of the applications in /bin. Are /all/ executables suffixed by 'app' > in OS/X? If not, you'd need something else from find, probably: I just did a cd into /Applications and then an ls. Only about half the applications had a .app suffix. Nothing in /bin did. > > find / -type f -perm +1 That won't work here. It barfs on the +. -- In the midst of great joy, do not promise anyone anything. In the midst of great anger, do not answer anyone's letter. -Chinese proverb