in reply to Re^9: Please suggest a non-forking way to do this (OS: windows)
in thread Please suggest a non-forking way to do this (OS: windows)

as far as I know, it's impossible to detect whether the pipe has data waiting.

Actually, you can. See PeekNamedPipe() which is explicitly documented as also working on:

a handle to the read end of an anonymous pipe, as returned by the CreatePipe function.

Though it is difficult to see how to integrate it with win32/win32sck.c win32_select() in order to allow select to operate in the *nix fashion on pipes as well as sockets?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^11: Please suggest a non-forking way to do this (OS: windows)
by ikegami (Patriarch) on Sep 30, 2008 at 15:57 UTC

    Win32API::File has a function that returns the system file handle associated with a Perl file handle, and Win32::API can give access to PeekNamedPipe with minimal fuss.

    Sounds like it's another working solution in this case, even if it can't be integrated with select.