Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

uvtee example doesn't work on windows #33

Open
vtjnash opened this issue Apr 27, 2013 · 2 comments
Open

uvtee example doesn't work on windows #33

vtjnash opened this issue Apr 27, 2013 · 2 comments
Assignees

Comments

@vtjnash
Copy link

vtjnash commented Apr 27, 2013

In the uvtee example, uv_pipe_open(&file_pipe, fd) fails on windows because internally it calls uv_set_pipe_handle which only works on something that is actually a named pipe. Should I open an issue at libuv instead? I'm not sure how to fix it.


I'm similarly not certain the example is fully functional on Linux either. Treating a pipe as a file isn't always valid. For example:

$ echo something > test.txt
$ ./uvtee hello.txt < test.txt 
Aborted (core dumped)

I have a hack that fixes this issue, I'm wondering if you think I should also submit this fix upstream?


Thanks for the manual!

@nikhilm
Copy link
Owner

nikhilm commented May 12, 2013

Thanks for bringing this up! I think the code in the book should have a check for the pipe-ness of the pipe. The fix itself will have to be upstream. I'd love a patch for the example.

@vtjnash
Copy link
Author

vtjnash commented May 13, 2013

I don't have a patch for the example, only for libuv on linux (although not high performant). I was pointing out that the statement in http://nikhilm.github.io/uvbook/filesystem.html#buffers-and-streams "This allows streaming local files [2]." is incorrect given libuv's current implementation on both the linux and windows operating systems -- specifically uv_pipe_open(&file_pipe, fd); fails or will cause libuv to abort().

@nikhilm nikhilm self-assigned this Feb 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants