# HG changeset patch # User wenzelm # Date 1229990163 -3600 # Node ID 89b0803404d7d24514a6605683c4ca1bb6ea5815 # Parent fa5224eb28a5e3357c0971636bb5c728f103fe65 added platform_file; added find_logics; diff -r fa5224eb28a5 -r 89b0803404d7 src/Pure/Tools/isabelle_system.scala --- a/src/Pure/Tools/isabelle_system.scala Mon Dec 22 19:57:49 2008 +0100 +++ b/src/Pure/Tools/isabelle_system.scala Tue Dec 23 00:56:03 2008 +0100 @@ -74,6 +74,9 @@ result_path.toString } + def platform_file(path: String) = + new File(platform_path(path)) + /* processes */ @@ -119,4 +122,18 @@ Array(platform_path("/bin/cat"), fifo)).getInputStream, charset)) else new BufferedReader(new InputStreamReader(new FileInputStream(fifo), charset)) + + /* find logics */ + + def find_logics() = { + val ml_ident = getenv_strict("ML_IDENTIFIER") + var logics: Set[String] = Set() + for (dir <- getenv_strict("ISABELLE_PATH").split(":")) { + val files = platform_file(dir + "/" + ml_ident).listFiles() + if (files != null) { + for (file <- files if file.isFile) logics += file.getName + } + } + logics.toList.sort(_ < _) + } }