Skip to content

Instantly share code, notes, and snippets.

@midwire
Created July 10, 2014 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save midwire/31379bee065749078667 to your computer and use it in GitHub Desktop.
Save midwire/31379bee065749078667 to your computer and use it in GitHub Desktop.
Simple file unlocking utility for Mac OSX.
#! /bin/bash
#
# Simple file unlocking utility for Mac OS X
#
ARGS=1
E_BADARGS=65
SETFILE=/Applications/Xcode.app/Contents/Developer/usr/bin/SetFile
function recursiveUnlock() {
pushd $1
for rdir in `ls -A`; do
if [ -d "${rdir}" ]; then
recursiveUnlock "${rdir}"
else
$SETFILE -a l "${rdir}"
fi
done
popd
}
if [ $# -ne "$ARGS" ]
then
echo "Usage: `basename $0` starting-directory"
exit $E_BADARGS
fi
recursiveUnlock $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment