|
|
Using MvMac when possible to increase speed
This script is really great except for one reason: it always uses CpMac even when what we want to remove is in the same volume in which ~/.Trash is. In that circunstance, MvMac will be much faster.
I propose an easy solution: just try MvMac and if it fails (because the volumes are different) try CpMac + rm. You have to replace de "move_file()" function in the script with this code:
move_file ()
{
if [ -n "$verbopt" ]; then
echo "Moving $1 to trash."
chflags -R nouchg "$1"
/Developer/Tools/MvMac "$1" "$dest" || (/Developer/Tools/CpMac "$1" "$dest" && /bin/rm "$1")
elif [ -n "$forceopt" ]; then
chflags -R nouchg "$1" > /dev/null 2>&1
/Developer/Tools/MvMac "$1" "$dest" > /dev/null 2>&1 || (/Developer/Tools/CpMac "$1" "$dest" > /dev/null 2>&1 && /bin/rm "$1" > /dev/null 2>&1)
else
chflags -R nouchg "$1"
/Developer/Tools/MvMac "$1" "$dest" || (/Developer/Tools/CpMac "$1" "$dest" && /bin/rm "$1")
fi
}
(The lines starting with /Developer... are quite long but must be written in one line)
Luis
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|