Exemplo n.º 1
0
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))
Exemplo n.º 2
0
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))
Exemplo n.º 3
0
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))
Exemplo n.º 4
0
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))
Exemplo n.º 5
0
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))