def with_output_to_file(s, proc, mode, exists, env, cont): # XXX mode and exists are currently ignored, they need to be translated into # the proper mode string. from pycket.prims.parameter import call_with_extended_paramz port = open_outfile(s, "wb") return call_with_extended_paramz(proc, [], [current_out_param], [port], env, close_cont(port, env, cont))
def with_input_from_file(s, proc, mode, env, cont): from pycket.prims.parameter import call_with_extended_paramz m = "rb" if mode is w_binary_sym else "r" port = open_infile(s, m) return call_with_extended_paramz(proc, [], [current_in_param], [port], env, close_cont(port, env, cont))
def with_output_to_file(s, proc, env, cont): from pycket.prims.parameter import call_with_extended_paramz port = open_outfile(s, "wb") return call_with_extended_paramz(proc, [], [current_out_param], [port], env, close_cont(port, env, cont))