mattmartini / itivo

Automatically exported from code.google.com/p/itivo
Other
0 stars 0 forks source link

Need to be able to have tmp folder on other than boot disk - is environment variable used? #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I have only about 3-5 GB on my MacBook - currently no chance I can make much 
more room
2. I have an external disk with lots of room and is where I target the final 
download
3. A Tivo show of about 1 GB (half hour SD) works, but a longer HD one fails.

What is the expected output? What do you see instead?
I expect it to use the external disk. Instead, the /tmp folder gets filled.  I 
do not know if that can 
be redirected.

What version of the product are you using? On what operating system?
1.6
10.5.5

Please provide any additional information below.
I am downloading the source to see if there is a way to use a designated tmp 
directory. 
Alternatively, if iTiVo used a sub-folder of /tmp, it perhaps could be soft 
linked to the other 
disk.  This would be an "expert" option but would halp me a lot.

Original issue reported on code.google.com by edbol...@gmail.com on 14 Dec 2008 at 11:59

GoogleCodeExporter commented 9 years ago
It appears that /tmp is hardcoded virtually EVERYWHERE!
On the other hand it looks like it is only in Perl scripts.  Replacing it with 
a variable would be a good start to 
reading a configuration or environment variable.
Why couldn't it be the same place as the final target folder?

Original comment by edbol...@gmail.com on 15 Dec 2008 at 12:06

GoogleCodeExporter commented 9 years ago
I take it that originally these were stored in the final target folder, but 
that caused problems with FileVault.  See 
Issue 9 -- http://code.google.com/p/itivo/issues/detail?id=9&can=1

Original comment by snov...@gmail.com on 15 Dec 2008 at 12:11

GoogleCodeExporter commented 9 years ago
Interesting.  In this case, the fix perhaps should be an option of WHERE the 
temp files should go.  The solution 
for FileVault users appears to "throw out the baby with the bathwater".

I'm not sure if I can scan the subversion tree for the changes needed to "undo" 
this "fix", but I will see if can be 
done.

Original comment by edbol...@gmail.com on 15 Dec 2008 at 12:24

GoogleCodeExporter commented 9 years ago
Yeah.. sadly /tmp/ is hardcoded all over the place.. did I mention the codebase 
is
UGLY?  It was hardcoded to be in the homedir before.. I just moved it to /tmp.. 

  Anyways, you don't want to undo the change (as there's new dependencies for
metadata and whatnot).  However, having an environment variable or .plist config
value that's hidden for most users but available for those who need it would 
work
(does apple/cocoa have some global tempdir setting?).

  Another option (probably the easiest for me) is to use a subdir in /tmp/... say
/tmp/iTiVo-<user>/
  and put all the tmp files in there.
  Then all you have to do is make /tmp/iTiVo-<user> a symlink into wherever you want
your tempfiles to be...
  Anyways.. marking as enhancement, and hopefully I'll get around to hacking that in
soon...  Damn this code needs a complete re-write in something OTHER than 
applescript...

Original comment by yoav.yer...@gmail.com on 15 Dec 2008 at 2:50

GoogleCodeExporter commented 9 years ago
As an experiment (which required my actually downloading the latest developer 
tools because they were never 
on my laptop! and finding I could actually install them on the external drive, 
mostly), I did search and replace 
for all of the /tmp in the Perl scripts and replaced with $TmpFolder.  I then 
put in some code to set it to 
"/tmp" if there was no environment variable (which there isn't ) named 
TmpFolder.  Perhaps better would have 
been to make that an arg to the scripts, which I think I'll do.
I changed the iTivo.applescript also so that everywhere it used /tmp, it 
instead used " & TmpFolder & "
I haven't figured out how or where to set TmpFolder to something - it is just 
/tmp right now!

I built and ran and it worked (after removing the elgato.applescript, which 
fails since there is no turbo.264 or 
whatever it wanted on my system).

So now that I have a duplicate of the original functions (which I managed to 
test with a small show), I'll change 
it to /tmp/iTiVo-bolson (hard coded still) and make a link as you suggested.

Original comment by edbol...@gmail.com on 15 Dec 2008 at 3:48

GoogleCodeExporter commented 9 years ago
Ok I made the lazy change and checked it in..
  If you want to have the tmp files go somewhere other than your main folder, before
you ever start iTiVo, open up a terminal and do (this will put it in the root 
volume
of your external disk):

  rm -rf /tmp/iTiVo*  
  mkdir /Volumes/<externaldiskname>/iTiVo
  ln -s /Volumes/<externaldiskname>/iTiVo /tmp/iTiVo-<username>

  (replace the <> with correct values).  Reply here if that didnt make sense, but
marking as 'fixed'... 

Original comment by yoav.yer...@gmail.com on 15 Dec 2008 at 3:50

GoogleCodeExporter commented 9 years ago
gah well you're welcome to keep a sepeate source tree (and if any changes you 
make
are nice and global-friendly.. send em back!)..
  but 1.7b3 actually uses /tmp/iTiVo-<username> so it *should* fix the problem
without needing to keep a seperate source tree..

Original comment by yoav.yer...@gmail.com on 15 Dec 2008 at 4:36

GoogleCodeExporter commented 9 years ago
Hey, no problem.  I didn't expect a fix or change so quickly, and it was fun to 
figure out a solution.  I'll just 
move my code and download the latest version.

Thanks for looking at it so quickly.

Original comment by edbol...@gmail.com on 15 Dec 2008 at 4:40