Eric Blake wrote: > However, I'm not sure on mingw how to detect whether an fd is open on a > regular file vs. a pipe. Any ideas?
Check out ser-mingw.c from gdb, they have a fair amount of MinGW pipe/fd
handling code there, e.g.
static int
fd_is_pipe (int fd)
{
if (PeekNamedPipe ((HANDLE) _get_osfhandle (fd), NULL, 0, NULL, NULL,
NULL))
return 1;
else
return 0;
}
Brian
