src/Pure/Thy/sessions.scala
changeset 68220 8fc4e3d1df86
parent 68219 c0341c0080e2
child 68221 dbef88c2b6c5
equal deleted inserted replaced
68219:c0341c0080e2 68220:8fc4e3d1df86
  1002     def output_log_gz(name: String): Path = output_dir + log_gz(name)
  1002     def output_log_gz(name: String): Path = output_dir + log_gz(name)
  1003 
  1003 
  1004     def open_output_database(name: String): SQL.Database =
  1004     def open_output_database(name: String): SQL.Database =
  1005       SQLite.open_database(output_dir + database(name))
  1005       SQLite.open_database(output_dir + database(name))
  1006 
  1006 
       
  1007     def clean_output(name: String): (Boolean, Boolean) =
       
  1008     {
       
  1009       val res =
       
  1010         for {
       
  1011           dir <- (if (system_mode) List(user_output_dir, system_output_dir) else List(user_output_dir))
       
  1012           file <- List(Path.basic(name), database(name), log(name), log_gz(name))
       
  1013           path = dir + file if path.is_file
       
  1014         } yield path.file.delete
       
  1015       val relevant = res.nonEmpty
       
  1016       val ok = res.forall(b => b)
       
  1017       (relevant, ok)
       
  1018     }
       
  1019 
  1007 
  1020 
  1008     /* input */
  1021     /* input */
  1009 
  1022 
  1010     def find_heap(name: String): Option[Path] =
  1023     def find_heap(name: String): Option[Path] =
  1011       input_dirs.map(_ + Path.basic(name)).find(_.is_file)
  1024       input_dirs.map(_ + Path.basic(name)).find(_.is_file)