From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 74F32BC88 for ; Wed, 2 Feb 2005 13:52:16 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j12CqFZr026503 for ; Wed, 2 Feb 2005 13:52:16 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA15779 for ; Wed, 2 Feb 2005 13:52:13 +0100 (MET) Received: from hedwig1.umh.ac.be (hedwig2.umh.ac.be [193.190.193.73]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j12CqDYU027796; Wed, 2 Feb 2005 13:52:13 +0100 Received: from poincare (mail@poincare.swapping.umh.ac.be [10.102.100.22]) by hedwig1.umh.ac.be (8.13.1/8.13.1) with ESMTP id j12CtbpI585852; Wed, 2 Feb 2005 13:55:39 +0100 Received: from poincare ([127.0.0.1] helo=localhost ident=trch) by poincare with esmtp (Exim 3.36 #1 (Debian)) id 1CwJzN-0002fM-00; Wed, 02 Feb 2005 13:52:09 +0100 Date: Wed, 02 Feb 2005 13:52:08 +0100 (CET) Message-Id: <20050202.135208.106936180.Christophe.Troestler@umh.ac.be> To: Xavier.Leroy@inria.fr Cc: caml-list@inria.fr Subject: Re: [Caml-list] [WISH] Unix.fstat and symlinks for win32 From: Christophe TROESTLER In-Reply-To: <20050202095420.GA8040@yquem.inria.fr> References: <20050201.110702.30392529.Christophe.Troestler@umh.ac.be> <20050202095420.GA8040@yquem.inria.fr> Organization: Universite de Mons-Hainaut (http://math.umh.ac.be/an/) X-Spook: PGP World Trade Center Project Monarch crypto anarchy Reno undercover S Box mania ANC PLO X-Blessing: Om Ah Hum Vajra Guru Pema Siddhi Hum X-Operating-System: GNU/Linux (http://www.linux.org/) X-Mailer-URL: http://www.mew.org/ X-Mailer: Mew version 4.2rc1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.1 (www dot roaringpenguin dot com slash mimedefang) X-Miltered: at concorde with ID 4200CD00.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4200CCFD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 fstat:01 symlinks:01 christophe:01 troestler:01 christophe:01 troestler:01 umh:01 wrote:01 fstat:01 lstat:01 lstat:01 behaves:01 imho:01 ocamldoc:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Wed, 2 Feb 2005, Xavier Leroy 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