summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/__init__.py3
-rw-r--r--ranger/core/main.py5
2 files changed, 5 insertions, 3 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py
index e20f55d8..8a1e7459 100644
--- a/ranger/__init__.py
+++ b/ranger/__init__.py
@@ -10,6 +10,7 @@ program you want to use to open your files with.
 
 import sys
 import os
+import tempfile
 
 # Information
 __license__ = 'GPL3'
@@ -24,7 +25,7 @@ TIME_BEFORE_FILE_BECOMES_GARBAGE = 1200
 MAX_RESTORABLE_TABS = 3
 MACRO_DELIMITER = '%'
 DEFAULT_PAGER = 'less'
-LOGFILE = '/tmp/ranger_errorlog'
+LOGFILE = tempfile.gettempdir()+'/ranger_errorlog'
 CACHEDIR = os.path.expanduser("~/.cache/ranger")
 USAGE = '%prog [options] [path]'
 VERSION = 'ranger-master %s\n\nPython %s' % (__version__, sys.version)
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 524a9a19..55102dc2 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -5,6 +5,7 @@
 
 import os.path
 import sys
+import tempfile
 
 def main():
     """initialize objects and run the filemanager"""
@@ -133,8 +134,8 @@ def main():
             import pstats
             profile = None
             ranger.__fm = fm
-            cProfile.run('ranger.__fm.loop()', '/tmp/ranger_profile')
-            profile = pstats.Stats('/tmp/ranger_profile', stream=sys.stderr)
+            cProfile.run('ranger.__fm.loop()', tempfile.gettempdir()+'/ranger_profile')
+            profile = pstats.Stats(tempfile.gettempdir()+'/ranger_profile', stream=sys.stderr)
         else:
             fm.loop()
     except Exception: