Closed
Description
We allow both mode strings ("r"
etc.) and keyword arguments (read=true
) in open
for both commands and files. Generally the mode strings correspond to equivalent keyword arguments. However they behave differently for processes:
julia> open(`ls foo`, read=true) do f
end
julia> ls: cannot access foo: No such file or directory
julia> open(`ls foo`, "r") do f
end
ls: cannot access foo: No such file or directory
ERROR: failed process: Process(`ls foo`, ProcessExited(2)) [2]
This is because there is a special method for opening a process with a function and mode string (which adds the ProcessFailedException), but the keyword arg form is caught by the fallback that just calls close
when the function returns. I assume we want them both to give the ProcessFailedException?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment