Browse code

Merge remote-tracking branch 'magec/feature/override_tmp_dir'

Will Tinsdeall authored on 2013/10/08 17:44:46
Showing 2 changed files
... ...
@@ -217,11 +217,11 @@ def mktmpsomething(prefix, randchars, createfunc):
217 217
     return dirname
218 218
 __all__.append("mktmpsomething")
219 219
 
220
-def mktmpdir(prefix = "/tmp/tmpdir-", randchars = 10):
220
+def mktmpdir(prefix = os.getenv('TMP','/tmp') + "/tmpdir-", randchars = 10):
221 221
     return mktmpsomething(prefix, randchars, os.mkdir)
222 222
 __all__.append("mktmpdir")
223 223
 
224
-def mktmpfile(prefix = "/tmp/tmpfile-", randchars = 20):
224
+def mktmpfile(prefix = os.getenv('TMP','/tmp') + "/tmpfile-", randchars = 20):
225 225
     createfunc = lambda filename : os.close(os.open(filename, os.O_CREAT | os.O_EXCL))
226 226
     return mktmpsomething(prefix, randchars, createfunc)
227 227
 __all__.append("mktmpfile")
... ...
@@ -418,8 +418,13 @@ about matching file names against exclude and include rules.
418 418
 For example to exclude all files with ".jpg" extension except those beginning with a number use:
419 419
 .PP
420 420
 	\-\-exclude '*.jpg' \-\-rinclude '[0-9].*\.jpg'
421
+
422
+.SH ENVIRONMENT
423
+.TP
424
+.B TMP
425
+Directory used to write temp files (/tmp by default)
421 426
 .SH SEE ALSO
422
-For the most up to date list of options run 
427
+For the most up to date list of options run
423 428
 .B s3cmd \-\-help
424 429
 .br
425 430
 For more info about usage, examples and other related info visit project homepage at