diff --git a/src/calibre/manual/customize.rst b/src/calibre/manual/customize.rst index d7b4e931d9..6218bf8112 100644 --- a/src/calibre/manual/customize.rst +++ b/src/calibre/manual/customize.rst @@ -21,6 +21,7 @@ Environment variables ----------------------- * ``CALIBRE_CONFIG_DIRECTORY`` - sets the directory where configuration files are stored/read. + * ``CALIBRE_TEMP_DIR`` - sets the temporary directory used by calibre * ``CALIBRE_OVERRIDE_DATABASE_PATH`` - allows you to specify the full path to metadata.db. Using this variable you can have metadata.db be in a location other than the library folder. Useful if your library folder is on a networked drive that does not support file locking. * ``CALIBRE_DEVELOP_FROM`` - Used to run from a calibre development environment. See :ref:`develop`. * ``CALIBRE_OVERRIDE_LANG`` - Used to force the language used by the interface (ISO 639 language code) diff --git a/src/calibre/ptempfile.py b/src/calibre/ptempfile.py index 71ae9b0789..ac7df1c4e3 100644 --- a/src/calibre/ptempfile.py +++ b/src/calibre/ptempfile.py @@ -40,7 +40,7 @@ def base_dir(): _base_dir = td else: _base_dir = tempfile.mkdtemp(prefix='%s_%s_tmp_'%(__appname__, - __version__)) + __version__), dir=os.environ.get('CALIBRE_TEMP_DIR', None)) atexit.register(remove_dir, _base_dir) return _base_dir