Lines Matching refs:out_file
42 def encode(in_file, out_file, name=None, mode=None, *, backtick=False): argument
64 if out_file == '-':
65 out_file = sys.stdout.buffer
66 elif isinstance(out_file, str):
67 out_file = open(out_file, 'wb')
68 opened_files.append(out_file)
79 out_file.write(('begin %o %s\n' % ((mode & 0o777), name)).encode("ascii"))
82 out_file.write(binascii.b2a_uu(data, backtick=backtick))
85 out_file.write(b'`\nend\n')
87 out_file.write(b' \nend\n')
93 def decode(in_file, out_file=None, mode=None, quiet=False): argument
122 if out_file is None:
124 out_file = hdrfields[2].rstrip(b' \t\r\n\f').decode("ascii")
125 if os.path.exists(out_file):
126 raise Error('Cannot overwrite existing file: %s' % out_file)
132 if out_file == '-':
133 out_file = sys.stdout.buffer
134 elif isinstance(out_file, str):
135 fp = open(out_file, 'wb')
136 os.chmod(out_file, mode)
137 out_file = fp
138 opened_files.append(out_file)
152 out_file.write(data)