54 |
structure Parse = ParseFn (structure Stabilize = Stabilize |
structure Parse = ParseFn (structure Stabilize = Stabilize |
55 |
val pending = AutoLoad.getPending) |
val pending = AutoLoad.getPending) |
56 |
|
|
57 |
fun cpTextStreams (ins, outs) = let |
(* copying an input file to an output file safely... *) |
58 |
|
fun copyFile (inf, outf) = let |
59 |
|
fun workIn ins = let |
60 |
|
fun workOut outs = let |
61 |
val N = 4096 |
val N = 4096 |
62 |
fun cp () = |
fun loop () = |
63 |
if TextIO.endOfStream ins then () |
if TextIO.endOfStream ins then () |
64 |
else (TextIO.output (outs, |
else (TextIO.output (outs, TextIO.inputN (ins, N)); |
65 |
TextIO.inputN (ins, N)); |
loop ()) |
66 |
cp ()) |
in |
67 |
in |
loop () |
68 |
cp () |
end |
69 |
end |
in |
70 |
|
SafeIO.perform { openIt = fn () => AutoDir.openTextOut outf, |
71 |
fun openTextStreams (inf, outf) () = |
closeIt = TextIO.closeOut, |
72 |
(TextIO.openIn inf, AutoDir.openTextOut outf) |
work = workOut, |
|
fun closeTextStreams (ins, outs) = |
|
|
(TextIO.closeIn ins; TextIO.closeOut outs) |
|
|
|
|
|
fun copyFile (inf, outf) = |
|
|
SafeIO.perform { openIt = openTextStreams (inf, outf), |
|
|
closeIt = closeTextStreams, |
|
|
work = cpTextStreams, |
|
73 |
cleanup = fn () => |
cleanup = fn () => |
74 |
(F.remove outf handle _ => ()) } |
(F.remove outf handle _ => ()) } |
75 |
|
end |
76 |
|
in |
77 |
|
SafeIO.perform { openIt = fn () => TextIO.openIn inf, |
78 |
|
closeIt = TextIO.closeIn, |
79 |
|
work = workIn, |
80 |
|
cleanup = fn () => () } |
81 |
|
end |
82 |
|
|
83 |
fun compile deliver dbopt = let |
fun compile deliver dbopt = let |
84 |
|
|
246 |
app show bootstrings |
app show bootstrings |
247 |
end |
end |
248 |
in |
in |
|
Say.say ["Runtime System PID is: ", rtspid, "\n"]; |
|
249 |
if deliver then |
if deliver then |
250 |
(SafeIO.perform { openIt = fn () => |
(SafeIO.perform { openIt = fn () => |
251 |
AutoDir.openTextOut pidfile, |
AutoDir.openTextOut pidfile, |
262 |
cleanup = fn () => |
cleanup = fn () => |
263 |
OS.FileSys.remove listfile |
OS.FileSys.remove listfile |
264 |
handle _ => () }; |
handle _ => () }; |
265 |
copyFile (SrcPath.osstring initgspec, cmifile)) |
copyFile (SrcPath.osstring initgspec, cmifile); |
266 |
|
Say.say ["Runtime System PID is: ", rtspid, "\n"]) |
267 |
else (); |
else (); |
268 |
true |
true |
269 |
end |
end |