Comment detail

ファイル更新の監視 (Nested Flatten)
JAVAと一緒。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import java.io._
def watchFile(name:String) = {
  val f = new File(name)
  var last = f.lastModified
  while(true){
    Thread.sleep(1000)
    if(f.lastModified != last) {
      println("modified!")
      last = f.lastModified
    }
  }
}

Index

Feed

Other

Link

Pathtraq

loading...