DropUnlock, DropNuke and Lion

DropNuke and DropUnlock were created solely to solve an odd hiccup in the early days of OS X, a problem that was fixed years ago. Since discontinuing DropNuke, however, I’ve received a handful of mails, replies and messages from people who used DropNuke beyond its original purpose. These have increased since Lion was released because, as PowerPC applications, neither DropNuke nor DropUnlock run under Lion.

Upgrading these applications, however, is not just a matter of recompiling them as Intel apps, because DropNuke and DropUnlock were not created in a traditional way. Creation of these applications took less than an hour, most of which was spent designing the icons. The actual “coding” took less time than it took to write this post. This rapid development time isn’t because I’m a fast coder; it’s because the apps are the output of Wilfredo Sánchez’s utility DropScript. What this application did is take Unix shell scripts (as well as Perl, Python, etc.) and wrap a Mac application around them that, when a file was dropped on the application, would execute the script passing the file as a parameter. Here is the complete code for DropNuke (which has been downloadable from the link at the top of this post since the apps were created):

#!/bin/sh
# EXTENSIONS : "*"
# OSTYPES    : "****"

for file; do
  location=$(dirname "$file")
  cd "${location}"
  chflags -R nouchg "${file}"
  rm -Rf "${file}"
done

The DropUnlock code is even simpler, eliminating the last rm call. Looking at the script now, I’m not even sure the first two lines in the loop even need to be there. In any case, you can see there isn’t much to these scripts. The real work is done by DropScript.

Alas, DropScript is a PowerPC application that produces PowerPC applications. Someone hell-bent on building Lion-compatible versions of DropNuke and DropUnlock would need to do the following:

  1. Download the source of the scripts.
  2. Do one of the following:
    1. Wait for Wilfredo Sánchez to update DropScript to support Intel applications.
    2. Download the source code to DropScript and get it working on Intel machines yourself. This might be a simple matter of just getting it to compile and rebuilding it, but I suspect not. It is likely that creating Intel apps from code is quite different than creating PowerPC apps was, back in the day.
  3. Run the resulting Intel-enabled version of DropScript and use it to build DropNuke and DropUnlock.
  4. Optionally, extract the icons from the original apps and apply them to the newly created versions.

Since I consider DropNuke too dangerous to release in the wild again (no more email about stray alias resolution accidentally deleting several terabytes of server data, thank you), and DropUnlock no longer really serves a purpose, I won’t be doing any of the above. All this code is available to you though. If you get it working, please drop me a line.

DropNuke discontinued

DropUnlockWhen it was first released, Mac OS X had an odd problem: it allowed a user to create files that they couldn’t delete. This wound up having to do with a bug between way OS 9 could “lock” files colliding with the way OS X did something similar. You could fix this on the command line, but I got sick of doing so, so built some quick utilities to handle this just by dragging and dropping.

One of these, DropUnlock, is still available, but today DivNull is officially discontinuing DropNuke. As you would expect with something named “DropNuke”, this version of the utility was pretty much the final option, a scorched earth way of permanently dealing with an undeletable file (using not only chflags calls, but also rm -rf). As you can tell by the warnings on its old download page, you could wreak a lot of havoc with DropNuke if you didn’t know what you are doing.

Since the “undeletable file” problem has been addressed in subsequent versions of OS X, and DropUnlock still exists for people still using the old version, it seems smarter to remove DropNuke, just in case.

Update: The technology on which DropNuke and DropUnlock was built doesn’t run on modern versions of OS X, so neither of these scripts will work any longer.