From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA02237 for caml-redistribution; Thu, 2 Sep 1999 20:36:47 +0200 (MET DST) 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 MAA29463 for ; Wed, 1 Sep 1999 12:02:16 +0200 (MET DST) Received: from miss.wu-wien.ac.at (miss.wu-wien.ac.at [137.208.107.17]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id MAA20130; Wed, 1 Sep 1999 12:02:15 +0200 (MET DST) Received: (from mottl@localhost) by miss.wu-wien.ac.at (8.9.0/8.9.0) id MAA32699; Wed, 1 Sep 1999 12:02:14 +0200 (MET DST) From: Markus Mottl Message-Id: <199909011002.MAA32699@miss.wu-wien.ac.at> Subject: Re: flush file buffer, etc To: Xavier.Leroy@inria.fr (Xavier Leroy) Date: Wed, 1 Sep 1999 12:02:14 +0100 (MET DST) Cc: caml-list@inria.fr (OCAML) In-Reply-To: <19990831213205.60338@pauillac.inria.fr> from "Xavier Leroy" at Aug 31, 99 09:32:05 pm X-Mailer: ELM [version 2.4 PL21] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: weis > > How do I flush a Unix.file_descr? [snip] > On the other hand, if you want to really commit the writes to the hard > disk, there is no function in the Unix module for this. But I'm not > even sure there exists a standardized Unix system call to do this. Maybe "fsync" would be appropriate. According to the man page this system call conforms to POSIX.1b (formerly POSIX.4). > > Deterimine if a file_descr isatty? > > Your best bet is to make isatty() available in Caml. The following C > wrapper and Caml declaration are all you need: Another solution, which works with the existing library, would be to simply call "tcgetattr fd" and catch the possibly resulting error "ENOTTY". E.g.: try ignore (tcgetattr fd) with Unix_error (ENOTTY,_,_) -> ... Regards, Markus Mottl -- Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl