src/Pure/System/standard_system.scala
changeset 43661 39fdbd814c7f
parent 43520 cec9b95fa35d
child 43664 47af50b0c8c5
--- a/src/Pure/System/standard_system.scala	Mon Jul 04 20:18:19 2011 +0200
+++ b/src/Pure/System/standard_system.scala	Mon Jul 04 22:11:32 2011 +0200
@@ -96,6 +96,16 @@
 
   def read_file(file: File): String = slurp(new FileInputStream(file))
 
+  def try_read(files: Seq[File]): String =
+  {
+    val buf = new StringBuilder
+    for {
+      file <- files if file.isFile
+      c <- (Source.fromFile(file) ++ Iterator.single('\n'))
+    } buf.append(c)
+    buf.toString
+  }
+
   def write_file(file: File, text: CharSequence)
   {
     val writer =