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


Click here to return to the 'Mimic Firefox for Windows' handling of Open With...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Mimic Firefox for Windows' handling of Open With...
Authored by: mkoistinen on Dec 24, '06 06:53:55AM
First of all, the OP has earned a vote of 5-stars from me, because this is a godsend hint that will prevent my Desktop from getting so cluttered with things I only meant to view/open (I've set Desktop as my Firefox download directory and that's where I will keep it). Secondly, I was indeed concerned about the security of placing things like my bank-statements that I download for viewing, etc. in /tmp, so, following the advice of others, including the guy/gal I'm replying to here. However, I've come up with, I think, an easier solution to manage overall: I've created a folder in /Library/StartupItems called "MkPrivateTmp". You can do this using the following command in a terminal window (click your desktop, then press CMD-SHIFT-U, then open "Terminal"):

sudo mkdir /Library/StartupItems/MkPrivateTmp
Assuming your account is set as an Admin account, enter your own password when prompted. If your account isn't an Admin account, then, well, you're out of luck, ask your administrator to set this up for you.

Inside this folder, you need to create two items: MkPrivateTmp (a script file - this is required to have the same name as the parent folder) and StartupParameters.plist (a required plist file). To create these files, use these commands:

cd /Library/StartupItems/MkPrivateTmp
sudo vi MkPrivateTmp
Then, in vi, press "I", then paste the contents listed below for "MkPrivateTmp" into the shell window, then press ":x". When finished with MkPrivateTmp, do the same for StartupParameters.plist.

MkPrivateTmp

#!/bin/csh

# Simply makes a private directory in tmp for each user
foreach USER (`ls -1 /Users`)
        if ( $USER != 'Shared' && $USER != '.localized' && $USER != '.DS_Store')
        then
                mkdir /tmp/{$USER} 2>&1
                chown {$USER}:{$USER} /tmp/{$USER} 2>&1
                chmod 700 /tmp/{$USER} 2>&1
        endif
end
StartupParameters.plist

//
// MkPrivateTmp
//
{
  Description     = "Provides a private /tmp directory for each user";
  Provides        = ("MkPrivateTmp");
  OrderPreference = "Early";
  Messages =
  {
    start = "Making per-user private directory in /tmp...";
  };
}
Now, set the ownership and permissions appropriately as follows:

sudo chown -R root:wheel /Library/StartupItems/MkPrivateTmp
sudo chmod -R 755 /Library/StartupItems/MkPrivateTmp
sudo chmod u+x /Library/StartupItems/MkPrivateTmp/MkPrivateTmp
Now, just reboot and /tmp will automatically have one folder per Mac-user with permission set only for him/her to read write and examine the contents of this private tmp folder. Now, in Safari, set the download directory to "/tmp/[yourusername]" instead of just "/tmp" and voila, you're in business. From now on, when you open a download in Firefox, it will indeed open, but it will not leave the download in your download folder (Desktop, for me). However, when you download a file, it will indeed, be placed wherever you've configured Firefox's downloads to go (again, Desktop, for me). I hope this helps someone else!

[ Reply to This | # ]