src/Pure/ML-Systems/smlnj-0.93.ML
changeset 4340 f5d7fbb73103
parent 3631 88a279998f90
child 4428 5c26253b8a2e
equal deleted inserted replaced
4339:b75312b2676d 4340:f5d7fbb73103
    88 (*execute Unix command which doesn't take any input from stdin and
    88 (*execute Unix command which doesn't take any input from stdin and
    89   sends its output to stdout; could be done more easily by IO.execute,
    89   sends its output to stdout; could be done more easily by IO.execute,
    90   but that function seems to be buggy in SML/NJ 0.93*)
    90   but that function seems to be buggy in SML/NJ 0.93*)
    91 fun execute command =
    91 fun execute command =
    92   let
    92   let
    93     val tmp_name = "/tmp/.isabelle-execute";	(*let's hope we win the race!*)
    93     val tmp_name = getenv "$ISABELLE_TMP" ^ "/isabelle-execute";
    94     val is = (System.system (command ^ " > " ^ tmp_name); open_in tmp_name);
    94     val is = (System.system (command ^ " > " ^ tmp_name); open_in tmp_name);
    95     val result = input (is, 999999);
    95     val result = input (is, 999999);
    96   in
    96   in
    97     close_in is;
    97     close_in is;
    98     System.Unsafe.SysIO.unlink tmp_name;
    98     System.Unsafe.SysIO.unlink tmp_name;