English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2005-02-02 (09:54)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] [WISH] Unix.fstat and symlinks for win32
> 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.

I don't quite understand your question: 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.

Still under Windows (native Windows, not Cygwin), Unix.lstat behaves
like Unix.stat and Unix.fstat is not implemented.  (I'm not even sure
the latter is implementable at all with the Win32 API.)

> Also, why not treat *.lnk as symbolic links under win32?  IMHO it
> would be more an asset than an hindrance.

The Cygwin emulation layer does this, so the Cygwin version of Caml
inherits that behavior.  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.  

Note that you could implement in Caml a library that sits on top of
Unix and provides *.lnk-aware versions of Unix.openfile and other
file-related calls.

- Xavier Leroy