# HG changeset patch # User paulson # Date 849088456 -3600 # Node ID dacee519738a44b7dbd76a6e0977f4c8766d526f # Parent 3ebeaaacfbd1a51d670ef266281136036e763b46 Converted I/O operatios for Basis Library compatibility diff -r 3ebeaaacfbd1 -r dacee519738a src/Pure/Thy/thy_read.ML --- a/src/Pure/Thy/thy_read.ML Wed Nov 27 10:52:31 1996 +0100 +++ b/src/Pure/Thy/thy_read.ML Wed Nov 27 10:54:16 1996 +0100 @@ -160,12 +160,13 @@ structures inherit this value.) *) val gif_path = ref (tack_on ("/" ^ - space_implode "/" (rev (tl (tl (rev (space_explode "/" (pwd ()))))))) + space_implode "/" (rev (tl (tl (rev (space_explode "/" + (OS.FileSys.getDir ()))))))) "Tools"); (*Path of Isabelle's main directory*) val base_path = ref ( - "/" ^ space_implode "/" (rev (tl (tl (rev (space_explode "/" (pwd ()))))))); + "/" ^ space_implode "/" (rev (tl (tl (rev (space_explode "/" (OS.FileSys.getDir ()))))))); (** HTML variables **) @@ -181,7 +182,7 @@ (*HTML file of theory currently being read (Initialized by thyfile2html; used by use_thy and store_thm)*) -val cur_htmlfile = ref None : outstream option ref; +val cur_htmlfile = ref None : TextIO.outstream option ref; (*Boolean variable which indicates if the title "Theorems proved in foo.ML" has already been inserted into the current HTML file*) @@ -192,18 +193,18 @@ -(*Make name of the output ML file for a theory *) +(*Make name of the TextIO.output ML file for a theory *) fun out_name tname = "." ^ tname ^ ".thy.ML"; (*Read a file specified by thy_file containing theory thy *) fun read_thy tname thy_file = let - val instream = open_in thy_file; - val outstream = open_out (out_name tname); + val instream = TextIO.openIn thy_file; + val outstream = TextIO.openOut (out_name tname); in - output (outstream, ThySyn.parse tname (input (instream, 999999))); - close_out outstream; - close_in instream + TextIO.output (outstream, ThySyn.parse tname (TextIO.inputAll instream)); + TextIO.closeOut outstream; + TextIO.closeIn instream end; fun file_exists file = (file_info file <> ""); @@ -286,7 +287,7 @@ fun get_filenames path name = let fun new_filename () = let val found = find_file path (name ^ ".thy"); - val absolute_path = absolute_path (pwd ()); + val absolute_path = absolute_path (OS.FileSys.getDir ()); val thy_file = absolute_path found; val (thy_path, _) = split_filename thy_file; val found = find_file path (name ^ ".ML"); @@ -389,7 +390,7 @@ index_path: relative path to directory containing main theory chart *) fun mk_charthead file tname title repeats gif_path index_path package = - output (file, + TextIO.output (file, "