Version française
Home     About     Download     Resources     Contact us    
Browse thread
[WISH] Unix.fstat and symlinks for win32
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christopher A. Watford <christopher.watford@g...>
Subject: Re: [Caml-list] [WISH] Unix.fstat and symlinks for win32
On Wed, 02 Feb 2005 13:52:08 +0100 (CET), Christophe TROESTLER
<Christophe.Troestler@umh.ac.be> wrote:
> Maybe the manual could be updated to reflect that?  [IMHO, it would be
>  nice if the windows peculiarities were in the ocamldoc comments -- I
>  usually use ocamlbrowser...]
> 
> > (I'm not even sure the latter is implementable at all with the
> > Win32 API.)
> 
> Windows gurus here?  (My goal with fstat was to know whether stdin was
> connected to a socket or a pipe.)

HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
BOOL isPipe = ((hStdin != NULL && hStdin != INVALID_HANDLE_VALUE) ?
   GetNamedPipeInfo(hStdin, NULL, NULL, NULL, NULL) :
   FALSE);

> Regards,
> ChriS

There is some dirty code to check if the handle for stdin is using
named pipe functions or if it is using read/write file functions. Yep,
horrible.

-- 
Christopher A. Watford
christopher.watford@gmail.com
http://dorm.tunkeymicket.com