Index: /releases/launch/1.1/launch/README
===================================================================
--- /releases/launch/1.1/launch/README	(revision 311)
+++ /releases/launch/1.1/launch/README	(revision 311)
@@ -0,0 +1,298 @@
+launch 1.1 [30 October 2006]
+==========
+
+A command-line launcher for Mac OS X in the spirit of open(1).
+
+Written by Nicholas Riley <mailto:launchsw@sabi.net>.
+Obtain updates from <http://web.sabi.net/nriley/software/>.
+
+WHAT IS IT?
+-----------
+
+Apple provides a simple command-line launching program called 'open'
+with Mac OS X.  It offers few options - launching applications by name
+or by path, launching TextEdit, or opening a number of applications,
+documents, folders, or URLs.  With the exception of special support for
+TextEdit (open -e), 'launch' does all this and:
+
+- opens URLs, directly or in your preferred helper application (-l)
+- lets you specify applications by their four-character creator
+  (e.g. 'ToyS') or Java-style bundle ID (e.g. com.apple.scripteditor),
+  both of which allow you to move or rename an application without
+  changing references to it
+- asks applications to print documents, something the OS X Finder
+  didn't get until Mac OS X 10.4
+- allows you to pipe output to GUI applictions
+- launches applications in the background
+- launches Carbon applications in Classic
+- displays file information including type, creator, bundle ID,
+  data and resource fork sizes, dates and version
+- reports errors intelligibly
+- and much more!
+
+'launch' is useful by itself, but is even better when used in scripts.
+Assign a shell command to your favorite Mac OS text, graphics or
+resource editor.  Go to your favorite Web site with a few keystrokes.
+
+Like 'open', 'launch' provides one half of the round-trip between
+Terminal.app and the Finder.  You can drag and drop icons or proxy icons
+into Terminal.app to insert their paths into command lines.  To go in the
+other direction, just type 'launch .' (or 'open .') to open a Finder window
+showing the current directory.
+
+INSTALLATION
+------------
+
+The commands below install the 'launch' tool in /usr/local/bin, which
+is in the default path.  You should subsequently be able to use
+'launch' by typing its name.  If you wish to install it somewhere else,
+modify the install line as appropriate.
+
+% sudo /usr/bin/install -d /usr/local/bin /usr/local/man/man1
+% sudo /usr/bin/install -c launch /usr/local/bin
+% sudo /usr/bin/install -c launch.1 /usr/local/man/man1
+% rehash
+
+Uninstallation:
+
+% sudo rm -f /usr/local/bin/launch /usr/local/man/man1/launch.1
+
+COMPILATION
+-----------
+
+An Xcode project, 'launch.xcodeproj', is included.  A precompiled
+Universal binary is also provided.  'launch' was developed and tested
+under Mac OS X 10.4.8 with Xcode 2.4, and does not require any
+additional software to build.
+
+USAGE
+-----
+
+Just type 'launch' by itself to receive usage information.
+
+Some examples:
+
+% launch -c 'R*ch'
+[BBEdit opens]
+                                
+% launch -pbc 'R*ch' test.txt
+[BBEdit starts printing test.txt in the background]
+
+% ls -l | launch -c CWIE -
+[CodeWarrior IDE opens with an untitled document containing the file list]
+
+% launch -i org.mozilla.camino http://www.apple.com/
+[Camino opens Apple's Web site]
+
+% launch -l launchsw@sabi.net
+[Your preferred email client opens a new message to comment on launch]
+
+% launch -f /Applications/Preview.app
+/Applications/Preview.app: Mac OS X application package
+        type: 'APPL'    creator: 'prvw'
+        architecture: Intel 80x86, PowerPC
+        bundle ID: com.apple.Preview
+        version: 3.0.8
+        kind: Application
+        content type ID: com.apple.application-bundle
+        contents: 1 item
+[...]
+
+A scripting example: a zsh function which provides an OS X wrapper
+around emacsclient and the Carbon build of GNU Emacs, using launch and
+appswitch (another one of my command-line tools).
+
+    e() {
+      ( emacsclient -n $@ >&/dev/null && \
+        appswitch -a Emacs ) || \
+      ( launch -ba Emacs && \
+  	until { emacsclient -n $@ >&/dev/null } do sleep 1; done;
+        appswitch -a Emacs )
+      export EDITOR=emacsclient
+    }
+
+FREQUENTLY ASKED QUESTIONS
+--------------------------
+
+Q. How do I discover bundle IDs for applications?
+
+A. The -f option to launch can help.  Say you have OmniWeb in the
+/Applications/Internet folder, and want to find out its bundle ID.
+Type 'launch -f', and drop the OmniWeb icon on Terminal:
+
+% launch -f /Applications/Internet/OmniWeb.app
+/Applications/Internet/OmniWeb.app: scriptable Mac OS X application package 
+        type: 'APPL'    creator: 'OWEB'
+        architecture: PowerPC, Intel 80x86
+        bundle ID: com.omnigroup.OmniWeb5
+
+Note that bundle IDs are not case-sensitive: com.barebones.BBEdit is
+the same as com.barebones.bbedit.
+
+
+Q. Why does application X open a file with a name beginning with 
+'launch-stationery-'?  
+
+A. Your application does not support stationery.  Applications which
+support stationery respond to it by creating a new untitled document
+with the contents of the stationery.  Most Cocoa applications, such as
+TextEdit, do not support stationery.  (Omni Group applications are a
+notable exception.)  If you're looking for a text editor which
+supports stationery, try BBEdit, Tex-Edit Plus, the CodeWarrior IDE,
+or almost any other Carbon editor.
+
+For the curious: launch processes input by simultaneously reading it
+and writing to a temporary stationery file.  Once reading is complete,
+launch opens the stationery file with your selected application, and
+deletes the stationery after one minute (as a safeguard, it is not
+possible to accurately gauge how long it will take for the application
+to open the stationery).
+
+
+Q. Why can't I use -f with -c to get info on an application with a
+given creator (or -f with -i for a bundle ID)?
+
+A. This feature may be added to a later version (or add it yourself!),
+but there is a workaround.  Instead of:
+
+% launch -f -c 'Doug'
+launch: can't get information (-f) on item(s) using an application (-u, -c, -i, -a)
+
+use:
+
+% launch -f "`launch -nc 'Doug'`"
+/Volumes/GrayApps/Utilities/Resorcerer 2.4/Resorcerer: scriptable Mac OS X application [Carbon, prefers native OS X]
+        type: 'APPL'    creator: 'Doug'
+        bundle ID: com.mathemaesthetics.resorcerer
+        version: 2.4 [0x2418010 = 37847056]
+        kind: Application
+[...]
+
+
+Q. Why doesn't launch support opening items as root?
+
+A. Apple eliminated this capability with the Mac OS X 10.1 Security
+Update.  If at some point Apple restores this capability, 'launch'
+will be ready to support it.
+
+
+Q. Why do I get an error -600?
+
+A. A typical occurrence of this would be:
+
+% launch -n .
+launch: can't open items: unable to connect to system service.
+Are you logged in? (-600)
+
+In order to perform certain operations, launch needs to talk to
+various system services owned by the currently logged-on user.  If you
+aren't using 'launch' from a terminal currently logged into the Mac OS
+X GUI, certain operations may not work.  Try opening Terminal, creating
+a new terminal window, and trying again.
+
+Another possibility is to create your own interprocess messaging.
+For example, place this script in a file:
+
+#!/bin/sh
+PIPE=/tmp/.launchpipe
+[ -e $PIPE ] || mkfifo $PIPE
+while true; do
+    read opts < $PIPE
+    eval "/path/to/launch $opts" & # change this to launch's path
+done
+
+Then, define a function or alias.  For zsh:
+
+rlaunch() { echo $@ > /tmp/.launchpipe }
+
+Or for tcsh:
+
+alias rlaunch 'echo \!* > /tmp/.launchpipe'
+
+Start the shell script above from the console, then you can use
+'rlaunch' in place of 'launch' logged in from anywhere else.
+
+Thanks to robert <robert@allyourbass.org> for this suggestion.
+
+COMMENTS, SUGGESTIONS, BUG REPORTS, ETC.
+----------------------------------------
+
+Please send to the author, Nicholas Riley, at <launchsw@sabi.net>.
+
+VERSION HISTORY
+---------------
+
+1.1 - 30 October 2006
+ - -L: send "launch" (ascr/noop) event to app, bypasses automatic
+   opening of untitled document, etc.
+ - -o: pass command-line arguments (broken, r. 4474993)
+ - display content type ID (UTI)    
+ - display architecture of Mach-O files
+ - switched to new LSOpen APIs (now requires Mac OS X 10.4 or later)
+ - switched to new date formatting APIs (the old ones are deprecated)
+ - for compatibility with open(1), take app path as argument to -a
+ - Universal Binary, compatible with Intel Macs [Peter Hosey]
+1.0.1 - 3 April 2005
+ - prefer files to URLs; added -U for old behavior
+ - don't display extraneous leading './' on file paths
+ - display 'zero items', not '0 items', for consistency
+ - display versions of non-applications
+ - read Info.plists embedded in unbundled Mach-O applications
+ - non-ASCII arguments are now handled with the filesystem, rather
+   than the system encoding [Derrick Bass]
+ - explicitly use UTF-8 everywhere else to properly interpret and
+   display non-ASCII filenames and URLs
+ - reading OSTypes and 'vers' resources, and opening URLs with
+   Internet Config still uses the system encoding, converting as
+   necessary for display
+ - should be buildable on 10.2 again
+1.0 - 23 October 2003
+ - work around CFBundle bug to report bundle identifiers and versions
+   from resource forks of unpackaged Carbon applications and Classic
+   applications [Lloyd Dupont]
+ - added descriptions for more error codes and clarified error
+   reporting
+ - output all errors to stderr
+ - provide better errors for -X option
+ - restored -m: OS X bug is fixed in Panther
+ - fixed a couple of tiny memory leaks
+ - added man page [Hisashi T Fujinaka]
+ - work around bug in LSOpenFromURLSpec opening multiple items in
+   Mac OS X 10.3
+1.0b2 - 9 March 2003
+ - fixed install instructions to create /usr/local/bin if needed
+ - show bundle version with text, hex and integer representations
+1.0b1 - 14 December 2002
+ - accept "slack" (default http) URLs and email addresses with -l
+ - accept input from stdin with '-'
+ - open URLs with arbitrary applications when specified without -l
+ - builds without compiler warnings
+1.0a9 - 2 April 2002
+ - license, comments changes
+1.0a8 - 29 March 2002
+ - errors with -l (from ICeCoffEE), added rlaunch script
+1.0a7 - 3 March 2002
+ - print dates, sizes, folder valence, locked status for -f
+ - don't abort on failure to obtain bundle information
+1.0a6 - 30 November 2001
+ - fixed incorrect messages, broken -u and crash on -nu
+1.0a5 - 28 November 2001
+ - print kind string for -f, still no new installer
+1.0a4 - 20 November 2001
+ - [try to] use Installer VISE instead of InstallAnywhere
+1.0a3 - 15 November 2001
+ - fixed package identification in -f, updated examples
+1.0a2 - 15 November 2001
+ - -f, removed broken -m
+1.0a1 - 14 November 2001
+ - renamed from "FindApp", launch by default, -u
+1.0d5 - 7 November 2001
+ - option -s for launching as root [nonfunctional]
+1.0d4 - 6 November 2001
+ - URL launching and Internet Config support
+1.0d3 - 4 November 2001
+ - more robust, support for docs without app
+1.0d2 - 4 November 2001
+ - options -opsbmhCX, -cin, documents
+1.0d1 - 26 August 2001
+ - returns path of application identified by creator
Index: /releases/launch/1.1/launch/VERSION
===================================================================
--- /releases/launch/1.1/launch/VERSION	(revision 311)
+++ /releases/launch/1.1/launch/VERSION	(revision 311)
@@ -0,0 +1,1 @@
+1.1
Index: /releases/launch/1.1/launch/launch.1
===================================================================
--- /releases/launch/1.1/launch/launch.1	(revision 311)
+++ /releases/launch/1.1/launch/launch.1	(revision 311)
@@ -0,0 +1,135 @@
+.Dd Mon Oct 30 2006      \" DATE 
+.Dt LAUNCH 1 LOCAL	 \" Program name and manual section number 
+.Os launch 1.1
+.Sh NAME
+.Nm launch
+.Nd find, open, print, or get information about files, folders, disks and URLs
+.Sh SYNOPSIS
+.Nm launch
+.Op Fl npswbmhCXLU          \" [-npswbmhCXLU]
+.Op Fl c Ar creator         \" [-c creator]
+.Op Fl i Ar bundleID        \" [-i bundleID]
+.Op Fl u Ar URL             \" [-u URL]
+.Op Fl a Ar name | Ar path  \" [-a name|path]
+.Op Ar item ...             \" [item ...]
+.Op Ar -                    \" [-]
+.Nm 
+.Op Fl npflswbmhCXLU
+.Ar item ...
+.Sh DESCRIPTION
+The
+.Nm
+command is a replacement for Mac OS X's
+.Xr open 1
+command and opens a file (or a folder/directory or URL), as if you had
+double-clicked its icon in the Finder. If no application is specified,
+the default application determined by Launch Services is used to open
+items.
+.Pp
+.Nm
+invoked with a file or URL argument will open the URL directly or in
+your preferred helper application. Applications can be specified by
+their four-character creators (e.g. 'ToyS') or Java-style bundle ID
+(e.g. com.apple.scripteditor).
+.Pp
+.Nm
+can ask applications to print documents, a feature the OS X Finder is
+still missing.  It can open applications in the background; can open
+multiple copies of applications; can open Carbon applications in
+Classic, or prevent Classic from starting; and can show information
+about any item on disk, including file type, creator, data and
+resource fork sizes, dates, and bundle ID.
+.Pp
+The options to
+.Nm
+are divided in three sections according to purpose. You can give
+.Nm
+a reference to an application in many ways, using the matching
+options. Once
+.Nm
+has identified one or more items, the action options indicate what to
+do with these items. Finally, if the action involves launching an
+application, the launch options allow further customization.
+.Ss Matching options
+.Bl -tag -width -indent
+.It Fl c Ar creator
+Match by creator (a four-character code, also known as a signature).
+.It Fl i Ar bundleID
+Match by bundle identifier, usually consisting of the reversed dot
+(.)-separated components of the application developer's Internet domain
+name, followed by the application name.  For example, the Finder's
+bundle identifier is
+.Ar com.apple.Finder .
+Bundle identifiers are not case-sensitive.
+.It Fl u Ar URL
+Match application at
+.Ar URL
+(which must be a file:// URL).
+.It Fl a Ar name | Ar path
+Match application named
+.Ar name
+or at the path
+.Ar path .
+.El
+.Pp
+In addition to the above, you can specify applications, documents,
+folders, disks and URLs as item arguments.
+.Ss Action options
+.Bl -tag -width -indent
+.It Fl n
+Print matching paths/URLs instead of opening them.
+.It Fl p
+Ask application(s) to print document(s).
+.It Fl f
+Display information about item(s).
+.It Fl l
+Launch URLs, treating "http://" URLs as Web sites instead of WebDAV
+resources.
+.El
+.Ss Launch options
+.Bl -tag -width -indent
+.It Fl s
+Launch target(s) as superuser, authenticating if needed.
+.It Fl w
+Wait for application to finish opening before exiting.
+.It Fl b
+Launch application in the background.
+.It Fl m
+Launch application again, even if already running.
+.It Fl h
+Hide application after it finishes opening.
+.It Fl C
+Force CFM/PEF Carbon application to open in Classic.
+.It Fl X
+Don't start the Classic environment for this Classic application if
+Classic isn't running.
+.It Fl L
+Suppress the normal opening behavior of the application; for example,
+opening an untitled document.  (This works by sending a "launch", or
+ascr/noop, Apple event to the application.)
+.It Fl U
+Interpret items as URLs, even if files with the same names as the URLs
+exist.  (This was the default behavior in
+.Nm
+1.0.)
+.El
+.Sh SEE ALSO 
+.\" List links in ascending order by section, alphabetically within a section.
+.\" Please do not reference files that do not exist without filing a bug report
+.Xr appswitch 1 ,
+.Xr GetFileInfo 1 ,
+.Xr open 1
+.Sh BUGS              \" Document known, unremedied bugs
+The
+.Fl h
+option requires the
+.Fl b
+option to be used as well, or Cocoa applications will not hide on
+startup.  This is a Mac OS X bug which is still unfixed as of Mac OS X
+10.4.8.
+.Sh AUTHOR
+.An "Nicholas Riley" Aq launchsw@sabi.net
+.Pp
+Original man page written by
+.An "Hisashi T Fujinaka" Aq htodd@twofifty.com .
+.\" .Sh HISTORY           \" Document history if command behaves in a unique manner 
Index: /releases/launch/1.1/launch/launch.xcodeproj/project.pbxproj
===================================================================
--- /releases/launch/1.1/launch/launch.xcodeproj/project.pbxproj	(revision 311)
+++ /releases/launch/1.1/launch/launch.xcodeproj/project.pbxproj	(revision 311)
@@ -0,0 +1,213 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 42;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		E194196509C40AFB00266191 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* main.c */; settings = {ATTRIBUTES = (); }; };
+		E194196709C40AFB00266191 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09AB6884FE841BABC02AAC07 /* CoreFoundation.framework */; };
+		E194196809C40AFB00266191 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F561F49F0139D7DD01AEEDB1 /* ApplicationServices.framework */; };
+		E194196909C40AFB00266191 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5E819BF0198DFF701AEEDB1 /* Carbon.framework */; };
+		E194196A09C40AFB00266191 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F579CF4B019A1C6D01AEEDB1 /* Security.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		08FB7796FE84155DC02AAC07 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; tabWidth = 8; };
+		09AB6884FE841BABC02AAC07 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
+		E194197009C40AFB00266191 /* launch */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = launch; sourceTree = BUILT_PRODUCTS_DIR; };
+		F561F49F0139D7DD01AEEDB1 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
+		F574340B01B8A47B01AEEDB1 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
+		F579CF4B019A1C6D01AEEDB1 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
+		F5C0CA9501B5740C01AEEDB1 /* README */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+		F5E819BF0198DFF701AEEDB1 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		E194196609C40AFB00266191 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				E194196709C40AFB00266191 /* CoreFoundation.framework in Frameworks */,
+				E194196809C40AFB00266191 /* ApplicationServices.framework in Frameworks */,
+				E194196909C40AFB00266191 /* Carbon.framework in Frameworks */,
+				E194196A09C40AFB00266191 /* Security.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		08FB7794FE84155DC02AAC07 /* launch */ = {
+			isa = PBXGroup;
+			children = (
+				08FB7795FE84155DC02AAC07 /* Source */,
+				08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
+				19C28FBDFE9D53C911CA2CBB /* Products */,
+				F5C0CA9501B5740C01AEEDB1 /* README */,
+				F574340B01B8A47B01AEEDB1 /* VERSION */,
+			);
+			name = launch;
+			sourceTree = "<group>";
+		};
+		08FB7795FE84155DC02AAC07 /* Source */ = {
+			isa = PBXGroup;
+			children = (
+				08FB7796FE84155DC02AAC07 /* main.c */,
+			);
+			name = Source;
+			sourceTree = "<group>";
+		};
+		08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
+			isa = PBXGroup;
+			children = (
+				F5E819BF0198DFF701AEEDB1 /* Carbon.framework */,
+				F561F49F0139D7DD01AEEDB1 /* ApplicationServices.framework */,
+				09AB6884FE841BABC02AAC07 /* CoreFoundation.framework */,
+				F579CF4B019A1C6D01AEEDB1 /* Security.framework */,
+			);
+			name = "External Frameworks and Libraries";
+			sourceTree = "<group>";
+		};
+		19C28FBDFE9D53C911CA2CBB /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				E194197009C40AFB00266191 /* launch */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		E194196209C40AFB00266191 /* launch */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = E194196C09C40AFB00266191 /* Build configuration list for PBXNativeTarget "launch" */;
+			buildPhases = (
+				E194196409C40AFB00266191 /* Sources */,
+				E194196609C40AFB00266191 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = launch;
+			productInstallPath = "$(HOME)/bin";
+			productName = launch;
+			productReference = E194197009C40AFB00266191 /* launch */;
+			productType = "com.apple.product-type.tool";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		08FB7793FE84155DC02AAC07 /* Project object */ = {
+			isa = PBXProject;
+			buildConfigurationList = E194195609C40AD400266191 /* Build configuration list for PBXProject "launch" */;
+			hasScannedForEncodings = 1;
+			mainGroup = 08FB7794FE84155DC02AAC07 /* launch */;
+			projectDirPath = "";
+			targets = (
+				E194196209C40AFB00266191 /* launch */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+		E194196409C40AFB00266191 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				E194196509C40AFB00266191 /* main.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+		E194195709C40AD400266191 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = (
+					ppc,
+					i386,
+				);
+				GCC_C_LANGUAGE_STANDARD = c99;
+				MACOSX_DEPLOYMENT_TARGET = 10.4;
+				PREBINDING = NO;
+				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+			};
+			name = Development;
+		};
+		E194195809C40AD400266191 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = (
+					ppc,
+					i386,
+				);
+				GCC_C_LANGUAGE_STANDARD = c99;
+				MACOSX_DEPLOYMENT_TARGET = 10.4;
+				PREBINDING = NO;
+				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+			};
+			name = Deployment;
+		};
+		E194196D09C40AFB00266191 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				PRODUCT_NAME = launch;
+				WARNING_CFLAGS = (
+					"-Wmost",
+					"-Wno-four-char-constants",
+					"-Wno-unknown-pragmas",
+				);
+				ZERO_LINK = NO;
+			};
+			name = Development;
+		};
+		E194196E09C40AFB00266191 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				INSTALL_PATH = "\U0001/usr/local/bin";
+				PRODUCT_NAME = launch;
+				WARNING_CFLAGS = (
+					"-Wmost",
+					"-Wno-four-char-constants",
+					"-Wno-unknown-pragmas",
+				);
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		E194195609C40AD400266191 /* Build configuration list for PBXProject "launch" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				E194195709C40AD400266191 /* Development */,
+				E194195809C40AD400266191 /* Deployment */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Development;
+		};
+		E194196C09C40AFB00266191 /* Build configuration list for PBXNativeTarget "launch" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				E194196D09C40AFB00266191 /* Development */,
+				E194196E09C40AFB00266191 /* Deployment */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Development;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}
Index: /releases/launch/1.1/launch/main.c
===================================================================
--- /releases/launch/1.1/launch/main.c	(revision 311)
+++ /releases/launch/1.1/launch/main.c	(revision 311)
@@ -0,0 +1,995 @@
+/*
+ launch - a smarter 'open' replacement
+ Nicholas Riley <launchsw@sabi.net>
+
+ Copyright (c) 2001-06, Nicholas Riley
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of this software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+*/
+
+#define BROKEN_AUTHORIZATION 1
+#define BROKEN_ARGUMENTS 1
+#define kComponentSignatureString "launch"
+
+#include <unistd.h>
+#include <sys/stat.h>
+#include <mach-o/fat.h>
+#include <mach-o/arch.h>
+#include <mach-o/loader.h>
+#include <Carbon/Carbon.h>
+#include <CoreServices/CoreServices.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include <ApplicationServices/ApplicationServices.h>
+
+#ifndef BROKEN_AUTHORIZATION
+#include <Security/Authorization.h>
+#include <Security/AuthorizationTags.h>
+#endif
+
+const char *APP_NAME;
+
+#define VERSION "1.1"
+
+#define STRBUF_LEN 1024
+#define ACTION_DEFAULT ACTION_OPEN
+
+struct {
+    OSType creator;
+    CFStringRef bundleID, name;
+    Boolean forceURLs;
+    enum { ACTION_FIND, ACTION_FIND_ITEMS,
+	   ACTION_OPEN, ACTION_OPEN_ITEMS, 
+	   ACTION_INFO_ITEMS, ACTION_LAUNCH_URLS } action;
+} OPTS = 
+{
+    kLSUnknownCreator, NULL, NULL, false,
+    ACTION_DEFAULT
+};
+
+#define DEFAULT_LAUNCH_FLAGS (kLSLaunchNoParams | kLSLaunchStartClassic | kLSLaunchAsync)
+
+LSApplicationParameters LPARAMS = {0, DEFAULT_LAUNCH_FLAGS, NULL, NULL, NULL, NULL, NULL};
+CFArrayRef ITEMS = NULL;
+FSRef APPLICATION;
+
+char *TEMPFILE = NULL;
+
+typedef struct {
+    OSStatus status;
+    const char *desc;
+} errRec, errList[];
+
+static errList ERRS = {
+    // Launch Services errors
+    { kLSUnknownErr, "unknown Launch Services error" },
+    { kLSApplicationNotFoundErr, "application not found" },
+    { kLSLaunchInProgressErr, "application is being opened; please try again after the application is open" },
+    { kLSNotRegisteredErr, "application not registered in Launch Services database" },
+    { kLSNoExecutableErr, "application package contains no executable, or an unusable executable" },
+    { kLSNoClassicEnvironmentErr, "Classic environment required but not available" },
+    { kLSMultipleSessionsNotSupportedErr, "unable to launch multiple instances of application" },
+#ifndef BROKEN_AUTHORIZATION
+    // Security framework errors
+    { errAuthorizationDenied, "authorization denied" },
+    { errAuthorizationCanceled, "authentication was cancelled" },
+#endif
+    // Internet Config errors
+    { icPrefNotFoundErr, "no helper application is defined for the URL's scheme" },
+    { icNoURLErr, "not a URL" },
+    { icInternalErr, "internal Internet Config error" },
+    // Misc. errors
+    { nsvErr, "the volume cannot be found (buggy filesystem?)" },
+    { procNotFound, "unable to connect to system service.\nAre you logged in?" },
+    { kCGErrorIllegalArgument, "window server error.\nAre you logged in?" },
+    { kCGErrorApplicationRequiresNewerSystem, "application requires a newer Mac OS X version" },
+    { fnfErr, "file not found" },
+    { 0, NULL }
+};
+
+void usage() {
+    fprintf(stderr, "usage: %s [-npswbmhCXLU] [-c creator] [-i bundleID] [-u URL] [-a name|path] [-o argument] [item ...] [-]\n"
+                    "   or: %s [-npflswbmhCXLU] "
+#ifndef BROKEN_ARGUMENTS
+                    "[-o argument] "
+#endif
+                    "item ...\n", APP_NAME, APP_NAME);
+    fprintf(stderr,
+        "  -n            print matching paths/URLs instead of opening them\n"
+        "  -p            ask application(s) to print document(s)\n"
+	"  -f            display information about item(s)\n"
+        "  -l            launch URLs (e.g. treat http:// URLs as Web sites, not WebDAV)\n"
+#ifndef BROKEN_AUTHORIZATION
+        "  -s            launch target(s) as superuser (authenticating if needed)\n"
+#endif
+        "  -w            wait for application to finish opening before exiting\n"
+        "  -b            launch application in the background\n"
+        "  -m            launch application again, even if already running\n"
+        "  -h            hide application once it's finished opening\n"
+        "  -C            force CFM/PEF Carbon application to launch in Classic\n"
+        "  -X            don't start Classic for this app if Classic isn't running\n"
+	"  -L            suppress normal opening behavior (e.g. untitled window)\n"
+	"  -U            interpret items as URLs, even if same-named files exist\n"
+        "  -c creator    match application by four-character creator code ('ToyS')\n"
+        "  -i bundle ID  match application by bundle identifier (com.apple.scripteditor)\n"
+        "  -u URL        open application at file:// URL (NOT RECOMMENDED for scripts)\n"
+        "  -a name|path  match application by name/path (NOT RECOMMENDED, very fragile)\n"
+#ifndef BROKEN_ARGUMENTS
+        "  -o argument   pass argument to application (may be specified more than once)\n"
+#endif
+        "'document' may be a file, folder, or disk - whatever the application can open.\n"
+        "'item' may be a file, folder, disk, or URL.\n\n");
+    fprintf(stderr, "launch "VERSION" (c) 2001-06 Nicholas Riley <http://web.sabi.net/nriley/software/>.\n"
+	            "Please send bugs, suggestions, etc. to <launchsw@sabi.net>.\n");
+
+    exit(1);
+}
+
+char *osstatusstr(OSStatus err) {
+    errRec *rec;
+    const char *errDesc = "unknown error";
+    char * const failedStr = "(unable to retrieve error message)";
+    static char *str = NULL;
+    size_t len;
+    if (str != NULL && str != failedStr) free(str);
+    for (rec = &(ERRS[0]) ; rec->status != 0 ; rec++)
+        if (rec->status == err) {
+            errDesc = rec->desc;
+            break;
+        }
+    len = strlen(errDesc) + 10 * sizeof(char);
+    str = (char *)malloc(len);
+    if (str != NULL)
+        snprintf(str, len, "%s (%ld)", errDesc, err);
+    else
+        str = failedStr;
+    return str;
+}
+
+void osstatusexit(OSStatus err, const char *fmt, ...) {
+    va_list ap;
+    const char *errDesc = osstatusstr(err);
+    va_start(ap, fmt);
+    fprintf(stderr, "%s: ", APP_NAME);
+    vfprintf(stderr, fmt, ap);
+    fprintf(stderr, ": %s\n", errDesc);
+    exit(1);
+}
+
+void errexit(const char *fmt, ...) {
+    va_list ap;
+    va_start(ap, fmt);
+    fprintf(stderr, "%s: ", APP_NAME);
+    vfprintf(stderr, fmt, ap);
+    fprintf(stderr, "\n");
+    exit(1);
+}
+
+#ifndef BROKEN_AUTHORIZATION
+
+Boolean authenticated(AuthorizationItem item, AuthorizationRef *pAuthRef) {
+    AuthorizationRights rights;
+    AuthorizationRights *authorizedRights;
+    AuthorizationFlags flags;
+    OSStatus err;
+
+    // Create an AuthorizationRef yet with the kAuthorizationFlagDefaults
+    // flags to get the user's current authorization rights.
+    rights.count = 0;
+    rights.items = NULL;
+    
+    flags = kAuthorizationFlagDefaults;
+
+    err = AuthorizationCreate(&rights,
+        kAuthorizationEmptyEnvironment, flags,
+        pAuthRef);
+        
+    rights.count = 1;
+    rights.items = &item;
+    
+    flags = kAuthorizationFlagExtendRights;
+    
+    // don't ask for a password, just return failure if no rights
+    err = AuthorizationCopyRights(*pAuthRef, &rights,
+        kAuthorizationEmptyEnvironment, flags, &authorizedRights);
+
+    switch (err) {
+    case errAuthorizationSuccess:
+        // we don't need these items, and they need to be disposed of
+        AuthorizationFreeItemSet(authorizedRights);
+        return true;
+    case errAuthorizationInteractionNotAllowed:
+        return false;
+    default:
+        osstatusexit(err, "unable to determine authentication status");
+    }
+    return false; // to satisfy compiler
+}
+
+void authenticate(AuthorizationItem item, AuthorizationRef authorizationRef) {
+    AuthorizationRights rights = {1, &item};
+    AuthorizationRights *authorizedRights;
+    AuthorizationFlags flags;
+    OSStatus err;
+
+    flags = kAuthorizationFlagInteractionAllowed | kAuthorizationFlagExtendRights;
+
+    // Here, since we've specified kAuthorizationFlagExtendRights and
+    // have also specified kAuthorizationFlagInteractionAllowed, if the
+    // user isn't currently authorized to execute tools as root 
+    // (kAuthorizationRightExecute), they will be asked for their password. 
+    // The err return value will indicate authorization success or failure.
+    err = AuthorizationCopyRights(authorizationRef,&rights,
+                        kAuthorizationEmptyEnvironment,
+                        flags,&authorizedRights);
+    
+    if (errAuthorizationSuccess == err)
+        AuthorizationFreeItemSet(authorizedRights);
+    else
+        osstatusexit(err, "unable to authenticate");
+}
+#endif
+
+CFURLRef normalizedURLFromString(CFStringRef str) {
+    CFURLRef url = CFURLCreateWithString(NULL, str, NULL);
+    if (url != NULL) {
+        CFURLRef absURL = CFURLCopyAbsoluteURL(url);
+        CFRelease(url);
+        url = NULL;
+        if (absURL != NULL) {
+            CFStringRef scheme = CFURLCopyScheme(absURL);
+            url = absURL;
+            if (scheme == NULL) {
+                CFRelease(url);
+                url = NULL;
+            } else {
+	        CFRelease(scheme);
+	    }
+        }
+    }
+    return url;
+}
+
+CFURLRef normalizedURLFromPrefixSlack(CFStringRef prefix, CFStringRef slackStr) {
+    CFStringRef str = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@%@"),
+                                               prefix, slackStr);
+    CFURLRef normalizedURL = normalizedURLFromString(str);
+    CFRelease(str);
+    return normalizedURL;
+}
+
+char *tempFile(int *fd) {
+    char *tmpDir = getenv("TMPDIR");
+    const char * const tempTemplate = "/launch-stationery-XXXXXXXX";
+    char *tempPath;
+    OSStatus err;
+    FSRef fsr;
+    FSCatalogInfo catalogInfo;
+    FileInfo *fInfo;
+
+    // create temporary file
+    if (tmpDir == NULL) tmpDir = "/tmp";
+    tempPath = (char *)malloc(strlen(tmpDir) + strlen(tempTemplate) + 1);
+    if (tempPath == NULL) errexit("can't allocate memory");
+    strcpy(tempPath, tmpDir);
+    strcat(tempPath, tempTemplate);
+    if ( (*fd = mkstemp(tempPath)) == -1)
+        errexit("can't create temporary file '%s'", tempPath);
+    // mark file as stationery
+    err = FSPathMakeRef((UInt8 *)tempPath, &fsr, NULL);
+    if (err != noErr) osstatusexit(err, "can't find '%s'", tempPath);
+    err = FSGetCatalogInfo(&fsr, kFSCatInfoFinderInfo, &catalogInfo, NULL, NULL, NULL);
+    if (err != noErr) osstatusexit(err, "can't get information for '%s'", tempPath);
+    fInfo = (FileInfo *)&(catalogInfo.finderInfo);
+    fInfo->finderFlags |= kIsStationery;
+    err = FSSetCatalogInfo(&fsr, kFSCatInfoFinderInfo, &catalogInfo);
+    if (err != noErr) osstatusexit(err, "can't set information for '%s'", tempPath);
+    
+    return tempPath;
+}
+
+char *stdinAsTempFile() {
+    unsigned char *buf;
+    int bufsize;
+    // Actual number of characters read, and therefore written.
+    ssize_t charCount;
+    int fd;
+    struct stat stat_buf;
+    char *tempFilePath;
+
+    tempFilePath = tempFile(&fd);
+
+    if (fstat(fd, &stat_buf) == -1)
+        errexit("can't fstat temporary file '%s'", tempFilePath);
+
+    bufsize = stat_buf.st_blksize;
+    if ( (buf = (unsigned char *)malloc(bufsize * sizeof(unsigned char))) == NULL)
+        errexit("can't allocate %ld bytes of buffer memory",
+                bufsize * sizeof(unsigned char));
+
+    // Loop until the end of the file.
+    while (1) {
+        // Read a block of input.
+        charCount = read(STDIN_FILENO, buf, bufsize);
+        if (charCount < 0) {
+            errexit("can't read from standard input");
+        }
+        // End of this file?
+        if (charCount == 0)
+            break;
+        // Write this block out.
+        if (write(fd, buf, charCount) != charCount)
+            errexit("error writing to file '%s'", tempFilePath);
+    }
+    free(buf);
+    return tempFilePath;
+}
+
+void getargs(int argc, char * const argv[]) {
+    extern char *optarg;
+    extern int optind;
+    int ch;
+    OSStatus err;
+    Boolean appSpecified = false;
+
+    if (argc == 1) usage();
+    
+    while ( (ch = getopt(argc, argv, "npflswbmhCXLUc:i:u:a:o:")) != -1) {
+        switch (ch) {
+        case 'n':
+            if (OPTS.action != ACTION_DEFAULT) errexit("choose only one of -n, -p, -f, -l options");
+            OPTS.action = ACTION_FIND;
+            break;
+        case 'p':
+            if (OPTS.action != ACTION_DEFAULT) errexit("choose only one of -n, -p, -f, -l options");
+            OPTS.action = ACTION_OPEN;
+            LPARAMS.flags |= kLSLaunchAndPrint;
+            break;
+        case 'f':
+            if (OPTS.action != ACTION_DEFAULT) errexit("choose only one of -n, -p, -f, -l options");
+            OPTS.action = ACTION_INFO_ITEMS;
+            break;
+        case 'l':
+            if (OPTS.action != ACTION_DEFAULT) errexit("choose only one of -n, -p, -f, -l options");
+            OPTS.action = ACTION_LAUNCH_URLS;
+            break;
+        case 's':
+#ifdef BROKEN_AUTHORIZATION
+	    errexit("-s option no longer functional after 10.1 Security Update, sorry");
+#else
+        {
+            AuthorizationRef authRef;
+            AuthorizationItem item = { kAuthorizationRightExecute, strlen(argv[0]), argv[0], 0 };
+            OSStatus err;
+            
+            if (authenticated(item, &authRef)) {
+                continue;
+            }
+            authenticate(item, authRef);
+            err = AuthorizationExecuteWithPrivileges(authRef, argv[0], 0, &argv[1], NULL);
+            if (err != noErr) osstatusexit(err, "unable to launch '%s' with superuser privileges", argv[0]);
+            exit(0); // XXX exit status propagate?
+        }
+#endif
+        case 'w': LPARAMS.flags ^= kLSLaunchAsync; break;      // synchronous
+        case 'b': LPARAMS.flags |= kLSLaunchDontSwitch; break; // open in background
+        case 'm': LPARAMS.flags |= kLSLaunchNewInstance; break;// open multiple
+        case 'h': LPARAMS.flags |= kLSLaunchAndHide; break;    // hide once launched
+        case 'C': LPARAMS.flags |= kLSLaunchInClassic; break;  // force Classic
+        case 'X': LPARAMS.flags ^= kLSLaunchStartClassic; break;// don't start Classic for app
+	case 'L':
+	{
+	    OSStatus err;
+	    LPARAMS.initialEvent = malloc(sizeof(AppleEvent));
+	    err = AECreateAppleEvent(kASAppleScriptSuite, kASLaunchEvent, NULL, kAutoGenerateReturnID, kAnyTransactionID, LPARAMS.initialEvent);
+	    if (err != noErr) osstatusexit(err, "unable to construct launch Apple Event", argv[0]);
+	}
+	case 'U': OPTS.forceURLs = true; break;
+        case 'c':
+            if (strlen(optarg) != 4) errexit("creator (argument of -c) must be four characters long");
+            OPTS.creator = htonl(*(OSTypePtr)optarg);
+	    appSpecified = true;
+            break;
+        case 'i':
+            OPTS.bundleID = CFStringCreateWithCString(NULL, optarg, kCFStringEncodingUTF8);
+	    appSpecified = true;
+            break;
+        case 'a':
+            err = FSPathMakeRef((UInt8 *)optarg, &APPLICATION, NULL);
+            if (err == noErr) {
+                LPARAMS.application = &APPLICATION;
+            } else {
+                OPTS.name = CFStringCreateWithCString(NULL, optarg, kCFStringEncodingUTF8);
+            }
+            appSpecified = true;
+            break;
+	case 'u':
+            { CFStringRef str = CFStringCreateWithCString(NULL, optarg, kCFStringEncodingUTF8);
+	      CFURLRef appURL = CFURLCreateWithString(NULL, str, NULL);
+  	      if (appURL == NULL)
+		  errexit("invalid URL (argument of -u)");
+	      err = CFURLGetFSRef(appURL, &APPLICATION);
+	      if (err != noErr)
+                  osstatusexit(err, "can't find application (argument of -u)");
+            }
+            LPARAMS.application = &APPLICATION;
+	    appSpecified = true;
+	    break;
+#ifndef BROKEN_ARGUMENTS
+        case 'o':
+            if (LPARAMS.argv == NULL)
+                LPARAMS.argv = CFArrayCreateMutable(NULL, 0, NULL);
+            CFArrayAppendValue((CFMutableArrayRef)LPARAMS.argv,
+                               CFStringCreateWithCString(NULL, optarg, kCFStringEncodingUTF8));
+            break;
+#endif
+        default: usage();
+        }
+    }
+    
+    argc -= optind;
+    argv += optind;
+    
+    if ( (OPTS.action == ACTION_FIND || OPTS.action == ACTION_LAUNCH_URLS ||
+	  OPTS.action == ACTION_INFO_ITEMS) && LPARAMS.flags != DEFAULT_LAUNCH_FLAGS)
+        errexit("options -s, -b, -m, -h, -C, -X apply to application launch (not -n, -f or -l)");
+    
+    if (OPTS.creator == kLSUnknownCreator && OPTS.bundleID == NULL && OPTS.name == NULL) {
+	if (argc == 0 && LPARAMS.application == NULL)
+	    errexit("must specify an application by -u, or one or more of -c, -i, -a");
+        if (!appSpecified) {
+            if (OPTS.action == ACTION_FIND)
+                OPTS.action = ACTION_FIND_ITEMS;
+            if (OPTS.action == ACTION_OPEN)
+                OPTS.action = ACTION_OPEN_ITEMS;
+        }
+    } else {
+	if (LPARAMS.application != NULL)
+	    errexit("application URL (argument of -u) incompatible with matching by -c, -i, -a");
+    }
+
+    if (OPTS.action == ACTION_LAUNCH_URLS && appSpecified)
+        errexit("launching URLs with a given application is not supported; try without -l");
+
+    if (OPTS.action == ACTION_INFO_ITEMS && appSpecified)
+	errexit("can't get information (-f) on item(s) using an application (-u, -c, -i, -a)");
+
+    if (argc == 0 && OPTS.action == ACTION_OPEN && LPARAMS.flags & kLSLaunchAndPrint)
+        errexit("print option (-p) must be accompanied by document(s) to print");
+    
+    if (argc != 0) {
+        int i;
+        OSStatus err;
+        CFStringRef argStr;
+        CFURLRef itemURL;
+        LSItemInfoRecord docInfo;
+
+        if (OPTS.action == ACTION_FIND)
+            errexit("application with documents only supported for open or print, not find");
+
+        // handle document/item/URL arguments
+        ITEMS = CFArrayCreateMutable(NULL, argc, NULL);
+        for (i = 0 ; i < argc ; i++) {
+            argStr = NULL;
+            if (strcmp(argv[i], "-") == 0) {
+                TEMPFILE = stdinAsTempFile();
+                itemURL = CFURLCreateFromFileSystemRepresentation(NULL, (UInt8 *)TEMPFILE, strlen(TEMPFILE), false);
+                LPARAMS.flags ^= kLSLaunchAsync;
+            } else {
+		struct stat stat_buf;
+		if (!OPTS.forceURLs && stat(argv[i], &stat_buf) == 0) {
+		    itemURL = NULL;
+		} else {
+		    argStr = CFStringCreateWithCString(NULL, argv[i], kCFStringEncodingUTF8);
+		    // check for URLs
+		    itemURL = normalizedURLFromString(argStr);
+		    if (itemURL == NULL && OPTS.action == ACTION_LAUNCH_URLS) {
+			// check for email addresses
+			if (strchr(argv[i], '@') != NULL && strchr(argv[i], '/') == NULL)
+			    itemURL = normalizedURLFromPrefixSlack(CFSTR("mailto:"), argStr);
+			// check for "slack" URLs
+			if (itemURL == NULL && strchr(argv[i], '.') != NULL && strchr(argv[i], '/') != argv[i])
+			    itemURL = normalizedURLFromPrefixSlack(CFSTR("http://"), argStr);
+		    }
+		}
+                if (itemURL == NULL) {
+                    // check for file paths
+                    itemURL = CFURLCreateFromFileSystemRepresentation(NULL, (UInt8 *)argv[i], strlen(argv[i]), false);
+                    err = LSCopyItemInfoForURL(itemURL, kLSRequestExtensionFlagsOnly, &docInfo);
+                    if (err != noErr) osstatusexit(err, "unable to locate '%s'", argv[i]);
+                }
+            }
+            CFArrayAppendValue((CFMutableArrayRef)ITEMS, itemURL);
+            // don't CFRelease the itemURL because CFArray doesn't retain it by default
+            if (argStr != NULL) CFRelease(argStr);
+        }
+    }
+}
+
+Boolean stringFromURLIsRemote(CFURLRef url, char *strBuffer) {
+    CFStringRef scheme = CFURLCopyScheme(url);
+    Boolean isRemote = !CFEqual(scheme, CFSTR("file"));
+    CFRelease(scheme);
+    
+    strBuffer[0] = '\0';
+    if (isRemote) {
+        CFStringRef urlString = CFURLGetString(url);
+	CFStringGetCString(urlString, strBuffer, STRBUF_LEN, kCFStringEncodingUTF8);
+	CFRelease(urlString);
+    } else {
+	if (CFURLGetFileSystemRepresentation(url, false, (UInt8 *)strBuffer, STRBUF_LEN)) {
+	    if (strBuffer[0] == '.' && strBuffer[1] == '/') {
+		// remove the leading "./"
+		char *fromBufPtr = strBuffer + 2;
+		while (true) {
+		    *strBuffer = *fromBufPtr;
+		    if (*fromBufPtr == '\0') break;
+		    strBuffer++;
+		    fromBufPtr++;
+		}
+	    }
+	} else {
+	    strcpy(strBuffer, "[can't get path: CFURLGetFileSystemRepresentation failed]");
+	}
+    }
+    return isRemote;
+}
+
+void printPathFromURL(CFURLRef url, FILE *stream) {
+    static char strBuffer[STRBUF_LEN];
+    check(url != NULL && stream != NULL);
+    stringFromURLIsRemote(url, strBuffer);
+    fprintf(stream, "%s\n", strBuffer);
+}
+
+void printDateTime(const char *label, UTCDateTime *utcTime, const char *postLabel, Boolean printIfEmpty) {
+    static CFDateFormatterRef formatter = NULL;
+    static char strBuffer[STRBUF_LEN];
+    if (formatter == NULL) {
+	formatter = CFDateFormatterCreate(NULL, CFLocaleCopyCurrent(), kCFDateFormatterShortStyle, kCFDateFormatterMediumStyle);
+    }
+    CFAbsoluteTime absoluteTime;
+    OSStatus err;
+
+    err = UCConvertUTCDateTimeToCFAbsoluteTime(utcTime, &absoluteTime);
+    if (err == kUTCUnderflowErr) {
+        if (printIfEmpty) printf("\t%s: (not set)\n", label);
+        return;
+    }
+    if (err != noErr) osstatusexit(err, "unable to convert UTC %s time", label);
+
+    CFStringRef dateTimeString = CFDateFormatterCreateStringWithAbsoluteTime(NULL, formatter, absoluteTime);
+    CFStringGetCString(dateTimeString, strBuffer, STRBUF_LEN, kCFStringEncodingUTF8);
+    
+    printf("\t%s: %s%s\n", label, strBuffer, postLabel);
+}
+
+#define DFORMAT(SIZE) ((float)(SIZE) / 1024.)
+
+void printSizes(const char *label, UInt64 logicalSize, UInt64 physicalSize, Boolean printIfZero) {
+    UInt32 bigSize = physicalSize >> 32, littleSize = physicalSize;
+    if (!printIfZero && bigSize == 0 && littleSize == 0) return;
+    printf("\t%s: ", label);
+    if (bigSize == 0) {
+        if (littleSize == 0) {
+            printf("zero bytes on disk (zero bytes used)\n"); return;
+        } else if (littleSize < 1024) printf("%lu bytes", littleSize);
+        else {
+            UInt32 adjSize = littleSize >> 10;
+            if (adjSize < 1024) printf("%.1f KB", DFORMAT(littleSize));
+            else {
+                adjSize >>= 10; littleSize >>= 10;
+                if (adjSize < 1024) printf("%.2f MB", DFORMAT(littleSize));
+                else {
+                    adjSize >>= 10; littleSize >>= 10;
+                    printf("%.2f GB", DFORMAT(littleSize));
+                }
+            }
+        }
+    } else {
+        if (bigSize < 256) printf("%lu GB", bigSize);
+        else {
+            bigSize >>= 2;
+            printf("%lu TB", bigSize);
+        }
+    }
+    printf(" on disk (%llu bytes used)\n", logicalSize);
+        
+}
+
+void printMoreInfoForRef(FSRef fsr) {
+    OSStatus err;
+    FSCatalogInfo fscInfo;
+
+    err = FSGetCatalogInfo(&fsr, kFSCatInfoNodeFlags | kFSCatInfoAllDates | kFSCatInfoDataSizes | kFSCatInfoRsrcSizes | kFSCatInfoValence, &fscInfo, NULL, NULL, NULL);
+    if (err != noErr) osstatusexit(err, "unable to get catalog information for file");
+
+    if (fscInfo.nodeFlags & kFSNodeIsDirectoryMask) {
+        printf("\tcontents: ");
+	switch (fscInfo.valence) {
+	case 0: printf("zero items\n"); break;
+	case 1: printf("1 item\n"); break;
+	default: printf("%lu items\n", fscInfo.valence);
+	}
+    } else {
+        printSizes("data fork size", fscInfo.dataLogicalSize, fscInfo.dataPhysicalSize, true);
+        printSizes("rsrc fork size", fscInfo.rsrcLogicalSize, fscInfo.rsrcPhysicalSize, false);
+    }
+
+    if (fscInfo.nodeFlags & (kFSNodeLockedMask | kFSNodeForkOpenMask)) {
+        printf("\tstatus:");
+        if (fscInfo.nodeFlags & kFSNodeLockedMask) {
+            if (fscInfo.nodeFlags & kFSNodeForkOpenMask) printf(" in use,");
+            printf(" locked");
+        } else {
+            printf(" in use");
+        }
+        printf("\n");
+    }
+    
+    printDateTime("created", &fscInfo.createDate, "", true);
+    printDateTime("modified", &fscInfo.contentModDate, "", true);
+    printDateTime("accessed", &fscInfo.accessDate, " [only updated by Mac OS X]", false);
+    printDateTime("backed up", &fscInfo.backupDate, "", false);
+}
+
+const char *utf8StringFromCFStringRef(CFStringRef cfStr) {
+    static char tmpBuffer[STRBUF_LEN];
+    CFStringGetCString(cfStr, tmpBuffer, STRBUF_LEN, kCFStringEncodingUTF8);
+    return tmpBuffer;
+}
+
+const char *utf8StringFromOSType(OSType osType) {
+    osType = ntohl(osType);
+    CFStringRef typeStr = CFStringCreateWithBytes(NULL, (UInt8 *)&osType, 4, CFStringGetSystemEncoding(), false);
+    if (typeStr == NULL) {
+	// punt to displaying verbatim
+	static char tmpBuffer[4];
+	tmpBuffer[4] = '\0';
+	strncpy(tmpBuffer, (const char *)&osType, 4);
+	return tmpBuffer;
+    }
+    const char *buffer = utf8StringFromCFStringRef(typeStr);
+    CFRelease(typeStr);
+    return buffer;
+}
+
+// based on Apple's "CheckExecutableArchitecture" sample code
+
+#define MAX_HEADER_BYTES 512
+
+void swapHeader(uint8_t *bytes, ssize_t length) {
+    for (ssize_t i = 0 ; i < length ; i += 4)
+        *(uint32_t *)(bytes + i) = OSSwapInt32(*(uint32_t *)(bytes + i));
+}
+
+void printExecutableArchitectures(CFURLRef url, bool printOnFailure) {
+    uint8_t path[PATH_MAX];
+    if (printOnFailure)
+        printf("\tarchitecture: ");
+        
+    if (!CFURLGetFileSystemRepresentation(url, true, path, PATH_MAX)) {
+        if (printOnFailure) printf("(can't get executable)\n");
+        return;
+    }
+    
+    int fd = open((const char *)path, O_RDONLY, 0777);
+    if (fd <= 0) {
+        if (printOnFailure) printf("(can't read)\n");
+        return;
+    }
+    
+    uint8_t bytes[MAX_HEADER_BYTES];
+    ssize_t length = read(fd, bytes, MAX_HEADER_BYTES);
+    close(fd);
+
+    if (length < sizeof(struct mach_header_64)) {
+        if (printOnFailure) printf("(can't read Mach-O header)\n");
+        return;
+    }
+
+    // Look for any of the six magic numbers relevant to Mach-O executables, and swap the header if necessary.
+    uint32_t num_fat = 0, magic = *((uint32_t *)bytes);
+    uint32_t max_fat = (length - sizeof(struct fat_header)) / sizeof(struct fat_arch);
+    struct fat_arch one_fat = {0}, *fat;
+    if (MH_MAGIC == magic || MH_CIGAM == magic) {
+        struct mach_header *mh = (struct mach_header *)bytes;
+        if (MH_CIGAM == magic) swapHeader(bytes, length);
+        one_fat.cputype = mh->cputype;
+        one_fat.cpusubtype = mh->cpusubtype;
+        fat = &one_fat;
+        num_fat = 1;
+    } else if (MH_MAGIC_64 == magic || MH_CIGAM_64 == magic) {
+        struct mach_header_64 *mh = (struct mach_header_64 *)bytes;
+        if (MH_CIGAM_64 == magic) swapHeader(bytes, length);
+        one_fat.cputype = mh->cputype;
+        one_fat.cpusubtype = mh->cpusubtype;
+        fat = &one_fat;
+        num_fat = 1;
+    } else if (FAT_MAGIC == magic || FAT_CIGAM == magic) {
+        fat = (struct fat_arch *)(bytes + sizeof(struct fat_header));
+        if (FAT_CIGAM == magic) swapHeader(bytes, length);
+        num_fat = ((struct fat_header *)bytes)->nfat_arch;
+        if (num_fat > max_fat) num_fat = max_fat;
+    }
+    
+    if (num_fat == 0) {
+        if (printOnFailure) printf("(none found)\n");
+        return;
+    }
+    
+    if (!printOnFailure)
+        printf("\tarchitecture: ");
+        
+    for (int i = 0 ; i < num_fat ; i++) {
+        if (i != 0) printf(", ");
+        const NXArchInfo *arch = NXGetArchInfoFromCpuType(fat[i].cputype, fat[i].cpusubtype);
+        if (arch == NULL) {
+            printf("unknown (cputype %d, subtype %d)", fat[i].cputype, fat[i].cpusubtype);
+            continue;
+        }
+        printf(arch->description);
+    }
+    printf("\n");
+}
+
+// 'context' is to match prototype for CFArrayApplierFunction, it's unused
+void printInfoFromURL(CFURLRef url, void *context) {
+    CFStringRef kind;
+    static char strBuffer[STRBUF_LEN];
+    
+    check(url != NULL && context == NULL);
+
+    if (stringFromURLIsRemote(url, strBuffer))
+        printf("<%s>: URL\n", strBuffer);
+    else {
+        static LSItemInfoRecord info;
+	CFStringRef version = NULL;
+	UInt32 intVersion = 0;
+        OSStatus err = LSCopyItemInfoForURL(url, kLSRequestAllInfo, &info);
+        Boolean haveFSRef;
+        FSRef fsr;
+        if (err != noErr) osstatusexit(err, "unable to get information about '%s'", strBuffer);
+        haveFSRef = CFURLGetFSRef(url, &fsr);
+        
+        printf("%s: ", strBuffer);
+        
+        // modifiers
+        if (info.flags & kLSItemInfoIsInvisible) printf("invisible ");
+        if (info.flags & kLSItemInfoAppIsScriptable) printf("scriptable ");
+        if (info.flags & kLSItemInfoIsNativeApp) printf("Mac OS X ");
+        if (info.flags & kLSItemInfoIsClassicApp) printf("Classic ");
+        
+        // kind
+        if (info.flags & kLSItemInfoIsVolume) printf("volume");
+        else if (info.flags & kLSItemInfoIsApplication) printf("application ");
+        else if (info.flags & kLSItemInfoIsPackage) printf("non-application ");
+        else if (info.flags & kLSItemInfoIsContainer) printf("folder");
+        else if (info.flags & kLSItemInfoIsAliasFile) printf("alias");
+        else if (info.flags & kLSItemInfoIsSymlink) printf("symbolic link");
+        else if (info.flags & kLSItemInfoIsPlainFile) printf("document");
+        else printf("unknown file system entity");
+
+        if (info.flags & kLSItemInfoIsPackage) printf("package ");
+
+        if (info.flags & kLSItemInfoAppPrefersNative) printf("[Carbon, prefers native OS X]");
+        else if (info.flags & kLSItemInfoAppPrefersClassic) printf("[Carbon, prefers Classic]");
+
+        printf("\n");
+        if (!(info.flags & kLSItemInfoIsContainer) || info.flags & kLSItemInfoIsPackage) {
+	    printf("\ttype: '%s'", utf8StringFromOSType(info.filetype));
+	    printf("\tcreator: '%s'\n", utf8StringFromOSType(info.creator));
+        }
+        if (info.flags & kLSItemInfoIsPackage || info.flags & kLSItemInfoIsApplication) {
+        	// a package, or possibly a native app with a 'plst' resource
+            CFBundleRef bundle = CFBundleCreate(NULL, url);
+            CFStringRef bundleID = NULL;
+            if (bundle == NULL && (info.flags & kLSItemInfoIsApplication)) {
+                if (info.flags & kLSItemInfoIsPackage || !haveFSRef) {
+                    printf("\t[can't access CFBundle for application]\n");
+                } else { // OS X bug causes this to fail when it shouldn't, so fake it
+                    SInt16 resFork = FSOpenResFile(&fsr, fsRdPerm);
+                    OSStatus err = ResError();
+                    if (err != noErr) {
+                        printf("\t[can't open resource fork: %s]\n", osstatusstr(err));
+                    } else {
+                        Handle h = Get1Resource('plst', 0);
+                        if ( (err = ResError()) != noErr || h == NULL) {
+                            if (err != noErr && err != resNotFound) osstatusexit(err, "unable to read 'plst' 0 resource");
+                        } else {
+                            CFDataRef plstData = CFDataCreate(NULL, (UInt8 *)*h, GetHandleSize(h));
+                            CFStringRef error;
+                            CFPropertyListRef infoPlist = CFPropertyListCreateFromXMLData(NULL, plstData, kCFPropertyListImmutable, &error);
+			    if (plstData != NULL) {
+				CFRelease(plstData);
+				plstData = NULL;
+			    } else {
+				// this function should handle the 'plst' 0 case too, but it doesn't provide error messages; however, it handles the case of an unbundled Mach-O binary, so it is useful as a fallback
+				infoPlist = CFBundleCopyInfoDictionaryForURL(url);
+			    }
+                            if (infoPlist == NULL) {
+                                printf("\t['plst' 0 resource invalid: %s]\n", utf8StringFromCFStringRef(error));
+                                CFRelease(error);
+                            } else {
+                                // mimic CFBundle logic below
+                                bundleID = CFDictionaryGetValue(infoPlist, kCFBundleIdentifierKey);
+                                if (bundleID != NULL) CFRetain(bundleID);
+                                version = CFDictionaryGetValue(infoPlist, CFSTR("CFBundleShortVersionString"));
+                                if (version == NULL)
+                                    version = CFDictionaryGetValue(infoPlist, kCFBundleVersionKey);
+                                if (version != NULL) CFRetain(version);
+                                CFRelease(infoPlist);
+                            }
+                        }
+                        VersRecHndl vers = (VersRecHndl)Get1Resource('vers', 1);
+                        if ( (err = ResError()) != noErr || vers == NULL) {
+                            if (err != noErr && err != resNotFound) osstatusexit(err, "unable to read 'vers' 1 resource");
+                        } else {
+                            if (version == NULL) { // prefer 'plst' version
+                                version = CFStringCreateWithPascalString(NULL, vers[0]->shortVersion, CFStringGetSystemEncoding()); // XXX use country code instead?
+                            }
+                            intVersion = ((NumVersionVariant)vers[0]->numericVersion).whole;
+                        }
+                        CloseResFile(resFork);
+                    }
+                }
+            } else {
+                bundleID = CFBundleGetIdentifier(bundle);
+                if (bundleID != NULL) CFRetain(bundleID);
+		// prefer a short version string, e.g. "1.0 Beta" instead of "51" for Safari
+                version = CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("CFBundleShortVersionString"));
+		if (version == NULL)
+		    version = CFBundleGetValueForInfoDictionaryKey(bundle, kCFBundleVersionKey);
+                if (version != NULL) {
+                    CFRetain(version);
+                    intVersion = CFBundleGetVersionNumber(bundle);
+                }
+                CFURLRef executable = CFBundleCopyExecutableURL(bundle);
+                if (executable != NULL) {
+                    printExecutableArchitectures(executable, true);
+                    CFRelease(executable);
+                }
+                CFRelease(bundle);
+            }
+            if (bundleID != NULL) {
+                printf("\tbundle ID: %s\n", utf8StringFromCFStringRef(bundleID));
+                CFRelease(bundleID);
+            }
+        } else {
+            printExecutableArchitectures(url, false);
+            if (haveFSRef) {
+                // try to get a version if we can, but don't complain if we can't
+                SInt16 resFork = FSOpenResFile(&fsr, fsRdPerm);
+                if (ResError() == noErr) {
+                    VersRecHndl vers = (VersRecHndl)Get1Resource('vers', 1);
+                    if (ResError() == noErr && vers != NULL) {
+                        version = CFStringCreateWithPascalString(NULL, vers[0]->shortVersion, CFStringGetSystemEncoding()); // XXX use country code instead?
+                        intVersion = ((NumVersionVariant)vers[0]->numericVersion).whole;
+                    }
+                }
+                CloseResFile(resFork);
+            }
+	}
+
+	if (version != NULL) {
+	    printf("\tversion: %s", utf8StringFromCFStringRef(version));
+	    if (intVersion != 0) printf(" [0x%lx = %lu]", intVersion, intVersion);
+	    putchar('\n');
+	    CFRelease(version);
+	}
+
+        // kind string
+        err = LSCopyKindStringForURL(url, &kind);
+        if (err != noErr) osstatusexit(err, "unable to get kind of '%s'", strBuffer);
+        printf("\tkind: %s\n", utf8StringFromCFStringRef(kind));
+	CFRelease(kind);
+        
+        if (haveFSRef) {
+            // content type identifier (UTI)
+            err = LSCopyItemAttribute(&fsr, kLSRolesAll, kLSItemContentType, (CFTypeRef *)&kind);
+            if (err == noErr) {
+                printf("\tcontent type ID: %s\n", utf8StringFromCFStringRef(kind));
+                CFRelease(kind);
+            }
+            printMoreInfoForRef(fsr);
+        }
+    }
+}
+
+
+void launchURL(CFURLRef url, ICInstance icInst) {
+    CFStringRef urlStr = CFURLGetString(url);
+    static char strBuffer[STRBUF_LEN];
+    long strStart, strEnd;
+    OSStatus err;
+
+    strBuffer[0] = '\0';
+    CFStringGetCString(urlStr, strBuffer, STRBUF_LEN, CFStringGetSystemEncoding()); // XXX no idea what encoding ICLaunchURL is supposed to take; leave as is for now
+    strStart = 0;
+    strEnd = strlen(strBuffer);
+    err = ICLaunchURL(icInst, "\p", strBuffer, strEnd, &strStart, &strEnd);
+    if (err != noErr) {
+        fprintf(stderr, "%s: unable to launch URL <%s>: %s\n", APP_NAME, strBuffer, osstatusstr(err));
+    }
+    
+    CFRelease(urlStr);
+}
+
+OSStatus openItems(void) {
+    if (ITEMS == NULL)
+        ITEMS = CFArrayCreate(NULL, NULL, 0, NULL);
+    // CFShow(LPARAMS.argv);
+    return LSOpenURLsWithRole(ITEMS, kLSRolesAll, NULL, &LPARAMS, NULL, 0);
+}
+
+int main (int argc, char * const argv[]) {
+    OSStatus err;
+    
+    APP_NAME = argv[0];
+    getargs(argc, argv);
+
+    if (OPTS.action == ACTION_FIND || OPTS.action == ACTION_OPEN) {
+        if (LPARAMS.application != NULL) goto findOK; // already have an application FSRef
+	err = LSFindApplicationForInfo(OPTS.creator, OPTS.bundleID, OPTS.name, &APPLICATION, NULL);
+        LPARAMS.application = &APPLICATION;
+        
+	if (err != noErr) {
+	    if (OPTS.name != NULL && !CFStringHasSuffix(OPTS.name, CFSTR(".app"))) {
+		OPTS.name = CFStringCreateMutableCopy(NULL, CFStringGetLength(OPTS.name) + 4, OPTS.name);
+		CFStringAppend((CFMutableStringRef)OPTS.name, CFSTR(".app"));
+		err = LSFindApplicationForInfo(OPTS.creator, OPTS.bundleID, OPTS.name, &APPLICATION, NULL);
+		if (err == noErr) goto findOK;
+	    }
+	    osstatusexit(err, "can't locate application");
+	}
+        findOK: ;
+    }
+    
+    switch (OPTS.action) {
+    case ACTION_FIND:
+	printPathFromURL(CFURLCreateFromFSRef(NULL, LPARAMS.application), stdout);
+	break;
+    case ACTION_OPEN:
+	err = openItems();
+	if (err != noErr) osstatusexit(err, "can't open application");
+	break;
+    case ACTION_FIND_ITEMS:
+        CFArrayApplyFunction(ITEMS, CFRangeMake(0, CFArrayGetCount(ITEMS)),
+			     (CFArrayApplierFunction) printPathFromURL, stdout);
+	break;
+    case ACTION_OPEN_ITEMS:
+	err = openItems();
+	if (err != noErr) osstatusexit(err, "can't open items");
+	break;
+    case ACTION_INFO_ITEMS:
+        CFArrayApplyFunction(ITEMS, CFRangeMake(0, CFArrayGetCount(ITEMS)),
+			     (CFArrayApplierFunction) printInfoFromURL, NULL);
+	break;
+    case ACTION_LAUNCH_URLS:
+    {
+        ICInstance icInst;
+        err = ICStart(&icInst, '\?\?\?\?'); // in case GCC trigraph handling is enabled
+        if (err != noErr) osstatusexit(err, "can't initialize Internet Config", argv[1]);
+        CFArrayApplyFunction(ITEMS, CFRangeMake(0, CFArrayGetCount(ITEMS)),
+                             (CFArrayApplierFunction) launchURL, icInst);
+        ICStop(icInst);
+        break;
+    }
+    }
+
+    if (TEMPFILE != NULL) {
+        // the application may take a while to finish opening the temporary file
+        daemon(0, 0);
+        sleep(60);
+        unlink(TEMPFILE);
+    }
+
+    return 0;
+}
Index: /releases/launch/1.1/openUp.c
===================================================================
--- /releases/launch/1.1/openUp.c	(revision 311)
+++ /releases/launch/1.1/openUp.c	(revision 311)
@@ -0,0 +1,109 @@
+/*
+  * Copyright (c) 2001 Apple Computer, Inc. All rights reserved.
+  *
+  * @APPLE_LICENSE_HEADER_START@
+  *
+  * The contents of this file constitute Original Code as defined in and
+  * are subject to the Apple Public Source License Version 1.1 (the
+  * "License").  You may not use this file except in compliance with the
+  * License.  Please obtain a copy of the License at
+  * http://www.apple.com/publicsource and read it before using this file.
+  *
+  * This Original Code and all software distributed under the License are
+  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
+  * License for the specific language governing rights and limitations
+  * under the License.
+  *
+  * @APPLE_LICENSE_HEADER_END@
+  */
+/*
+  * Shantonu Sen <ssen@apple.com>
+  * openUp.c - program to set the "first-open-window" field of a volume
+  *
+  * Get the directory ID for the first argument, and set it as word 2
+  * of the Finder Info fields for the volume it lives on
+  *
+  * cc -o openUp openUp.c
+  * Usage: openUp /Volumes/Foo/OpenMe/
+  *
+  */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/attr.h>
+#include <sys/stat.h>
+#include <sys/mount.h>
+
+struct directoryinfo {
+	unsigned long length;
+	u_int32_t dirid;
+};
+
+struct volumeinfo {
+	unsigned long length;
+	u_int32_t  finderinfo[8];
+};
+
+const char *APP_NAME;
+
+void errnoexit(const char *fmt, ...) {
+	va_list ap;
+	va_start(ap, fmt);
+	fprintf(stderr, "%s: ", APP_NAME);
+	vfprintf(stderr, fmt, ap);
+	fprintf(stderr, " (%s)\n", strerror(errno));
+	exit(1);
+}
+
+int main(int argc, char *argv[]) {
+	
+	char *path = NULL;
+	struct attrlist alist;
+	struct directoryinfo dirinfo;
+	struct volumeinfo volinfo;
+	struct statfs sfs;
+	int err;
+	
+	APP_NAME = argv[0];
+	
+	if (argc != 2) {
+		fprintf(stderr, "usage: %s <path to folder whose window should open when volume is mounted>\n",
+				APP_NAME);
+		exit(1);
+	}
+	
+	path = argv[1];
+	
+	bzero(&alist, sizeof(alist));
+	alist.bitmapcount = 5;
+	alist.commonattr = ATTR_CMN_OBJID;
+	
+	if (getattrlist(path, &alist, &dirinfo, sizeof(dirinfo), 0))
+		errnoexit("getattrlist on path failed");
+	
+	printf("directory id: %lu\n", dirinfo.dirid);
+	
+	if (statfs(path, &sfs))
+		errnoexit("statfs failed");
+	
+	printf("mountpoint: %s\n", sfs.f_mntonname);
+	
+	alist.commonattr = ATTR_CMN_FNDRINFO;
+	alist.volattr = ATTR_VOL_INFO;
+	
+	if (getattrlist(sfs.f_mntonname, &alist, &volinfo, sizeof(volinfo), 0))
+		errnoexit("getattrlist on mount point failed");
+	volinfo.finderinfo[2] = dirinfo.dirid;
+	if (setattrlist(sfs.f_mntonname, &alist, volinfo.finderinfo,
+		sizeof(volinfo.finderinfo), 0))
+		errnoexit("setattrlist on mount point failed");
+	
+	return 0;
+
+}
+
Index: /releases/launch/1.1/package-launch.sh
===================================================================
--- /releases/launch/1.1/package-launch.sh	(revision 311)
+++ /releases/launch/1.1/package-launch.sh	(revision 311)
@@ -0,0 +1,20 @@
+#!/bin/zsh
+
+set -x -v
+
+cd launch && \
+find . -name \*~ -exec rm '{}' \; && \
+xcodebuild -configuration Deployment clean && \
+xcodebuild -configuration Deployment DSTROOT=/ "INSTALL_PATH=$PWD" install && \
+SetFile -c 'R*ch' -t 'TEXT' README VERSION launch.1 && \
+sudo /usr/bin/install -c launch /usr/local/bin && \
+sudo /usr/bin/install -c launch.1 /usr/local/man/man1 && \
+chmod 755 launch && \
+chmod 644 launch.1 && \
+VERSION=`cat VERSION` TARBALL="launch-$VERSION.tar.gz" && \
+cd .. && \
+rm -f launch-$VERSION $TARBALL $DMG && \
+ln -s launch launch-$VERSION && \
+tar --owner=root --group=wheel --exclude=.DS_Store --exclude=.svn --exclude=.gdb_history --exclude=build --exclude=\*.mode2 --exclude=\*.pbxuser --exclude=\*.perspective -zchf launch-$VERSION.tar.gz launch-$VERSION && \
+scp $TARBALL ainaz:web/nriley/software/ #$DMG 
+:
