aboutsummaryrefslogtreecommitdiff
path: root/tools/response_file.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/response_file.py')
-rw-r--r--tools/response_file.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/tools/response_file.py b/tools/response_file.py
index 29756833..312cda73 100644
--- a/tools/response_file.py
+++ b/tools/response_file.py
@@ -1,21 +1,19 @@
import tempfile, os, sys, shlex
-from tempfiles import try_delete
# Routes the given cmdline param list in args into a new response file and returns the filename to it.
-# The response file has a suffix '.tmp' to signal that the process receiving the response file is free to delete it after it has consumed it.
-# The returned filename has '@' prepended to it already for convenience.
+# The returned filename has a suffix '.rsp'.
def create_response_file(args, directory):
- (response_fd, response_filename) = tempfile.mkstemp(prefix='emscripten_', suffix='.tmp', dir=directory, text=True)
+ (response_fd, response_filename) = tempfile.mkstemp(prefix='emscripten_', suffix='.rsp', dir=directory, text=True)
response_fd = os.fdopen(response_fd, "w")
#print >> sys.stderr, "Creating response file '%s'" % response_filename
args = map(lambda p: p.replace(' ', '').replace('\\', '\\\\').replace('"', '\\"'), args)
response_fd.write(' '.join(args))
response_fd.close()
- return '@' + response_filename
+ return response_filename
# Reads a response file, and returns the list of cmdline params found in the file.
-# If the response file ends with .tmp, it is automatically deleted after reading it.
-def read_and_delete_response_file(response_filename):
+# The parameter response_filename may start with '@'.
+def read_response_file(response_filename):
if response_filename.startswith('@'):
response_filename = response_filename[1:]
@@ -26,9 +24,5 @@ def read_and_delete_response_file(response_filename):
response_fd = open(response_filename, 'r')
args = response_fd.read()
response_fd.close()
- # For conveniency, the receiver is allowed to immediately clean up response files ending with '.tmp' so that the
- # caller doesn't have to do it.
- if response_filename.endswith(".tmp"):
- try_delete(response_filename)
args = shlex.split(args)
return args