Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Markus Mottl <mottl@miss.wu-wien.ac.at>
To: Xavier.Leroy@inria.fr (Xavier Leroy)
Cc: caml-list@inria.fr (OCAML)
Subject: Re: flush file buffer, etc
Date: Wed, 1 Sep 1999 12:02:14 +0100 (MET DST)	[thread overview]
Message-ID: <199909011002.MAA32699@miss.wu-wien.ac.at> (raw)
In-Reply-To: <19990831213205.60338@pauillac.inria.fr> from "Xavier Leroy" at Aug 31, 99 09:32:05 pm

> > 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




      reply	other threads:[~1999-09-02 18:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-30 17:36 John Skaller
1999-08-31 19:32 ` Xavier Leroy
1999-09-01 11:02   ` Markus Mottl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199909011002.MAA32699@miss.wu-wien.ac.at \
    --to=mottl@miss.wu-wien.ac.at \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox