Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
import java.io.{ FileNotFoundException, FileOutputStream, PrintStream }
|
||||
import java.time.LocalDateTime
|
||||
|
||||
object TakeNotes extends App {
|
||||
val notesFileName = "notes.txt"
|
||||
if (args.length > 0) {
|
||||
val ps = new PrintStream(new FileOutputStream(notesFileName, true))
|
||||
ps.println(LocalDateTime.now() + args.mkString("\n\t", " ", "."))
|
||||
ps.close()
|
||||
} else try {
|
||||
io.Source.fromFile(notesFileName).getLines().foreach(println)
|
||||
} catch {
|
||||
case e: FileNotFoundException => println(e.getLocalizedMessage())
|
||||
case e: Throwable => {
|
||||
println("Some other exception type:")
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue