Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Changes for 10.6' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Changes for 10.6
Authored by: TokyoJimu on Mar 31, '10 04:28:40PM

In 10.6 (Snow Leopard), the output of "file --mime" has changed, breaking the view_attachment script. I have fixed it by replacing:

if [ -z "$type" ]; then
type=`file -b --mime "$1" | cut -d"/" -f2`
fi

with:

# Get the OS version number and strip out the decimal points so we can
# use integer comparison, and so it will work for future versions.
syssubver=`sw_vers -productVersion | sed s/\\.//g`

# if the type is empty then try to figure it out.
if [ -z "$type" ]; then
if [ $syssubver -lt.1060 ]; then #OS X 10.5 or lower
type=`file -b --mime "$1" | cut -d"/" -f2`
else # For 10.6, you need the following instead
type=`file -b --mime-type "$1" | cut -d"/" -f2`
fi
fi



[ Reply to This | # ]