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 80DAFBC8B for ; Wed, 2 Feb 2005 23:06:47 +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 j12M6l83008995 for ; Wed, 2 Feb 2005 23:06:47 +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 XAA08523 for ; Wed, 2 Feb 2005 23:06:46 +0100 (MET) Received: from smtp813.mail.sc5.yahoo.com (smtp813.mail.sc5.yahoo.com [66.163.170.83]) by nez-perce.inria.fr (8.13.0/8.13.0) with SMTP id j12M6jaP002336 for ; Wed, 2 Feb 2005 23:06:45 +0100 Received: from unknown (HELO ?192.168.1.100?) (rftp@pacbell.net@63.194.18.166 with plain) by smtp813.mail.sc5.yahoo.com with SMTP; 2 Feb 2005 22:06:44 -0000 Message-ID: <42014F70.9040509@rftp.com> Date: Wed, 02 Feb 2005 14:08:48 -0800 From: Robert Roessler Organization: Robert's High-performance Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Xavier Leroy Cc: Christophe TROESTLER , "O'Caml Mailing List" Subject: Re: [Caml-list] [WISH] Unix.fstat and symlinks for win32 References: <20050201.110702.30392529.Christophe.Troestler@umh.ac.be> <20050202095420.GA8040@yquem.inria.fr> In-Reply-To: <20050202095420.GA8040@yquem.inria.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 42014EF7.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42014EF5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 fstat:01 symlinks:01 wrote:01 lstat:01 behaves:01 fstat:01 api:01 largefile:01 largefile:01 api:01 runtime:01 run-time:01 symbolic:01 stati:98 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: 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. > > > 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.) Actually, not only is [LargeFile.]fstat implementable under Win32, but so are [LargeFile.]ftruncate... not to mention that pause and alarm *could* be done also, but possibly not as cleanly as the former four. Details on the above: ftruncate and LargeFile.ftruncate would work on ALL Win32 platforms, using ::SetFilePointer and ::SetEndOfFile (the "::" is what I use to distinguish API calls from app or C runtime calls). fstat and LargeFile.fstat would (according the .NET 2003 C Run-Time Library Reference) work on all Win32 platforms EXCEPT Windows 95, using _fstati64. Note that one needs to examine the actual sys/stat.h file to see that "_S_IFIFO" is used to denote pipes. alarm could be done with ::SetTimer, and even be made to work in concert with pause, which could use (pick your favorite variant) some form of ::[Msg]WaitFor{Single,Multiple}Object[s]... but you would need to take some care WRT Windows event processing. :) As for the ".lnk" files, they don't really correspond with *nix notions of either "hard" or "symbolic" links, so attempts at mapping them are bound to disappoint some (if not all). My USD 0.02. Robert Roessler robertr@rftp.com http://www.rftp.com