Browse thread
[WISH] Unix.fstat and symlinks for win32
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2005-02-02 (12:52) |
From: | Christophe TROESTLER <Christophe.Troestler@u...> |
Subject: | Re: [Caml-list] [WISH] Unix.fstat and symlinks for win32 |
On Wed, 2 Feb 2005, Xavier Leroy <Xavier.Leroy@inria.fr> wrote: > > > Just a small note to tell that I think it would be nice to have > > support for Unix.*stat on win32. Not all characteristics may make > > sense but [file_kind], [st_size], [st_perm], [st_*time] do. > > Unix.stat is implemented under Windows (building on the _stati64() > function provided by the MS C library) and sets the fields you > mention to reasonable values. Sorry for the confusion: I was interested in Unix.fstat and when somebody told me it does not work on win32 (I do not use win32 myself but try to write portable code whenever possible), I had a (too) quick look at the manual which says that [lstat], [fstat] are not implemented -- should not have put a star. > Still under Windows (native Windows, not Cygwin), Unix.lstat behaves > like Unix.stat and Unix.fstat is not implemented. 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.) > > Also, why not treat *.lnk as symbolic links under win32? > > For the native Windows ports, I think this wouldn't fit the "spirit" > of these ports, which is to remain relatively close to the semantics > of the underlying OS (Windows) and provide Unix-like wrappers that > are quite thin. Thanks for the explanation. (Still there is http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/ishelllink/ishelllink.asp but I do not know whether it fits the bill or whether it is worth the trouble.) Regards, ChriS