Skip to content

Conversation

@thomasyang1207
Copy link

Pipe is not a subclass of IOStream or LibUVStream, but is a subclass of AbstractPipe, which the redirect family of functions does not currently handle.

@kshyatt kshyatt added docs This change adds or pertains to documentation io Involving the I/O subsystem: libuv, read, write, etc. labels Feb 23, 2019
@kshyatt
Copy link
Member

kshyatt commented Feb 23, 2019

This addresses #31145. @thomasyang1207 (welcome to Julia!) was maybe interested in getting these methods to work for Pipes again if anyone wanted to provide some guidance!

@JeffBezanson
Copy link
Member

Pipe endpoints and IOStreams (usually a file opened by open) are also supported. You can pass a pipe endpoint using e.g. pipe.in, but I'm not sure if that's recommended.

@tlienart
Copy link
Contributor

Shouldn't this currently just be Union{Base.LibuvStream, IOStream} as per https://github.com/JuliaLang/julia/blob/master/base/stream.jl#L1024 ? (I guess that's what Jeff is pointing out before)

Also maybe it would be nice to add an example? for instance with IOStream:

foo() = println("hello");
open("test.test","w") do outf
    redirect_stdout(outf) do
        foo()
    end
end

(PS: apologies if I'm polluting this PR, I saw the issue #31145, started replying there and then realised this PR was still open)

@vtjnash
Copy link
Member

vtjnash commented Dec 17, 2019

Yeah, let's just make Pipe work

@vtjnash vtjnash closed this Dec 17, 2019
@StefanKarpinski
Copy link
Member

Can you open an issue for making Pipe work then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs This change adds or pertains to documentation io Involving the I/O subsystem: libuv, read, write, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants