/var/folders – are you kidding me?
My friend Steve just asked me about /var/folders on Mac OS X. I had never heard of it. But guess what? It’s a freaking caches of all kinds of shit, including screen shots of every web page you’ve ever been to in Safari.
It’s outside your home directory. Even if you have FileVault turned on. If you turn private browsing on, it seems like stuff is NOT written there, but I’m not 100% sure of that yet.
What the hell, Apple? That’s Microsoft-style security. ALL USER SHIT GOES IN THE USER HOME DIRECTORY. Dammit.
Guess what I’m adding to my boot script?
rm -rf /var/folders/*
April 15th, 2009 at 4:37 pm
So wanna know what crappy solution I have for this? My Macbook is single user.
cd /var
sudo mv folders crap
sudo rm -rf crap/*
mkdir ~/.folders
sudo ln -s ~/folders folders
Gross! but now the crap is in my own user folder and can be file-vaulted and such
April 15th, 2009 at 4:42 pm
Wait, is this better?
newfs_hfs /dev/disk2
Initialized /dev/rdisk2 as a 1024 MB HFS Plus volume
mkdir /tmp/ramdisk1
mount -t hfs /dev/disk2 /tmp/ramdisk1
sudo rm -rf /var/folders
sudo ln -s /tmp/ramdisk1/ /var/folder
April 16th, 2009 at 7:18 am
The second one might be better, definitely for multi-user systems. I guess you’d want to clear the ramdisk on logout somehow.