When running luxconsole as a slave node it usually creates temporary files for the scene it is processing.
Currently it creates these files in the "current directory" - whichever directory you launch luxconsole from.
I recently added a command line option to allow specifying an alternative directory to place these files in:
-c [ --cachedir ] arg Specify the cache directory to use
I called this cachedir instead of tempdir because of work being done on bug 614 which will allow these files to be saved on the slave node between instances of running luxconsole.
This has the potential to lead to many files appearing in unexpected locations for some users. How would you feel about changing the default location to the users temp directory?
I propose using boost::filesystem::temp_directory_path() / "luxrender"
temp_directory_path() will return the users personal temp directory on windows, and on unix will check the environment variables TMPDIR, TMP, TEMP, and TEMPDIR in that order, with a fallback to /tmp.
Thus files will by default be saved in for example:
/tmp/luxrender
or
C:\Users\Omniflux\AppData\Local\Temp\luxrender
There is a downside to this on unix systems which by default use a shared temp directory; the directory and files will be owned by the first user to run luxconsole as a slave node. Other users can work around this by specifying another directory with -c, or we could use another default directory incorporating the username or userid (/tmp/luxrender-omniflux or /tmp/luxrender-1001).
A traditional method is to use the process id as part of the temporary directory name, however for this directory to function as a cache directory, the path must remain stable between instantiations.
What are your thoughts on this?
