X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/a95a01077068e27009d4240aa0fc0c8f58908c6b..d351d679283a797c98f5f65d18aa757c18e56305:/src/slave.sml diff --git a/src/slave.sml b/src/slave.sml index 719b417..64613ed 100644 --- a/src/slave.sml +++ b/src/slave.sml @@ -181,4 +181,18 @@ fun writeList (fname, ls) = TextIO.closeOut outf end +fun lineInFile fname line = + let + val inf = TextIO.openIn fname + val line' = line ^ "\n" + + fun loop () = + case TextIO.inputLine inf of + NONE => false + | SOME line => line = line' orelse loop () + in + loop () + before TextIO.closeIn inf + end handle IO.Io _ => false + end