caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Maxence Guesdon <max@sbuilders.com>
To: Robert Longeon <Robert.Longeon@cnrs-dir.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list]  =?iso-8859-1?Q?Comment_rediriger_les_entrées/sorties_?=  standards ?
Date: Wed, 02 May 2001 16:49:07 +0200	[thread overview]
Message-ID: <3AF01E63.D484FA83@sbuilders.com> (raw)
In-Reply-To: <4.2.0.58.20010502143518.00da89a0@cezanne.auteuil.cnrs-dir.fr>


> Bonjour,
> 
> Je voudrait rediriger les entrées/sorties standards. Je croyais pouvoir le
> faire en tapant :
> 
> let std_out = open_out "c:\projet\entree"
> 
> mais  l'écriture se fait toujours à l'écran. De même en utilisant
> 
> output_string std_out "toto"
> 
> le fichier est toujours vide. Je vois pourquoi, ça ne peut pas marcher ...
> mais y a-t-il un moyen de rediriger les E/S standards ?
Ceci marche sous Unix :

let _ = Unix.close Unix.stdout
let _ = open_out "tutu"

Il est très important que ton fichier ouvert par open_out soit le premier
fichier ouvert après le Unix.close, car le système se servira alors du premier
descripteur libre (0 ici, qui vient d'être libéré par la fermeture de stdout)
lors de l'ouverture de ton fichier, et c'est justement ce descripteur 0 qui est
utilisé par la suite par les opérations d'affichage sur la sortie standard.
Encore une fois, c'est sous Unix, je ne sais pas si le comportement est le même
sous Win$*%#.

--
Maxence Guesdon

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  reply	other threads:[~2001-05-02 14:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-02 12:42 [Caml-list] Comment rediriger les entrées/sorties " Robert Longeon
2001-05-02 14:49 ` Maxence Guesdon [this message]
     [not found] ` <200105021455.f42EtjL25069@waco.inria.fr>
2001-05-02 15:20   ` [Caml-list] Comment_rediriger_les_entrees/sorties_standards ? Robert Longeon
2001-05-03  6:21 ` [Caml-list] Comment rediriger les entrées/sorties standards ? Bruno Pagano
2001-05-03  9:51 ` [Caml-list] " Xavier Leroy

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=3AF01E63.D484FA83@sbuilders.com \
    --to=max@sbuilders.com \
    --cc=Robert.Longeon@cnrs-dir.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;
as well as URLs for NNTP newsgroup(s).