Sophie

Sophie

distrib > Fedora > 16 > x86_64 > media > updates-src > by-pkgid > 7859c1967c8ed4687471342875aff626 > files > 3

tnef-1.4.9-1.fc16.src.rpm

#! /bin/bash
# /usr/bin/tnef.sh
# 
# nautilus helper to extract a tnef file's contents into a subfolder of the 
#     tnef file's location.
#   todo: 
# error checking (disk space, unwritable etc).
# how could the calling nautilus window be told to refresh it's contents so the
#    extracted folder becomes visible straight away. (for paths with spaces).
filefullpath="$1"
file=`basename "$filefullpath"`
filepath="`dirname "$filefullpath"`/"$file".extract"
#echo $filefullpath
#echo $file
#echo $filepath
if ! [ -d "$filepath" ]; then
  echo "  creating folder $filepath..."
  mkdir "$filepath"
  echo "  extracting $file tnef contents..."
  tnef --verbose --save-body -C "$filepath" "$filefullpath"
  echo "  complete."
  sleep 4
else
  echo "  default extract folder $filepath"
  echo "      already exists, extraction aborted."
  sleep 6
fi