summaryrefslogtreecommitdiffstats
path: root/TOOLS/file2string.py
diff options
context:
space:
mode:
Diffstat (limited to 'TOOLS/file2string.py')
-rwxr-xr-xTOOLS/file2string.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/TOOLS/file2string.py b/TOOLS/file2string.py
index b641a1df2f..1f2cd64fdf 100755
--- a/TOOLS/file2string.py
+++ b/TOOLS/file2string.py
@@ -39,5 +39,10 @@ def file2string(infilename, infile, outfile):
outfile.write('"' + ''.join(conv[c] for c in line) + '"\n')
if __name__ == "__main__":
+ if len(sys.argv) < 2:
+ outfile = sys.stdout
+ else:
+ outfile = open(sys.argv[2], "w")
+
with open(sys.argv[1], 'rb') as infile:
- file2string(sys.argv[1], infile, sys.stdout)
+ file2string(sys.argv[1], infile, outfile)