Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / stubs / mlton-stubs / io.sig
1 (* Copyright (C) 2002-2007 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 *
4 * MLton is released under a BSD-style license.
5 * See the file MLton-LICENSE for details.
6 *)
7
8 signature MLTON_IO_ARG =
9 sig
10 type instream
11 type outstream
12
13 val inFd: instream -> Posix.IO.file_desc
14 val newIn: Posix.IO.file_desc * string -> instream
15 val newOut: Posix.IO.file_desc * string -> outstream
16 val outFd: outstream -> Posix.IO.file_desc
17 end
18
19 signature MLTON_IO =
20 sig
21 include MLTON_IO_ARG
22
23 (* mkstemp s creates and opens a new temp file with prefix s, returning
24 * the name of the temp file and the outstream to write to it.
25 *)
26 val mkstemp: string -> string * outstream
27 (* mkstemps is like mkstemp, except it has both a prefix and suffix. *)
28 val mkstemps: {prefix: string, suffix: string} -> string * outstream
29 (* adds a suitable system or user specific prefix (dir) for temp files *)
30 val tempPrefix: string -> string
31 end