Language detail: XUL
Coverage: 0.76%
|
number of '+' ratings |
contribution for coverage |
Unsolved challenges
- LL Golf Hole 6 - 10進数を2進数に基数変換する (Nested Flatten)
- LL Golf Hole 5 - 最上位の桁を数え上げる (Nested Flatten)
- echoクライアント (Nested Flatten)
- LL Golf Hole 4 - 文章から単語の索引を作る (Nested Flatten)
- LL Golf Hole 3 - 13日の金曜日を数え上げる (Nested Flatten)

zigorou #395() [ XUL ] Rating0/0=0.00
var FileWatch = function(filename, duration) { this.file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); this.file.initWithPath(filename); this.duration = duration; }; FileWatch.prototype = { iid: null, lastTime: null, watch: function() { this.lastTime = (new Date()).getTime(); var self = this; this.iid = setInterval(function() { self.watchFile(); }, this.duration * 1000); }, watchFile: function() { if (this.file.lastModifiedTime - this.lastTime > 0) { this.log("modified"); } this.lastTime = (new Date()).getTime(); }, log: function(message) { Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService).logStringMessage(message); }, unwatch: function() { clearInterval(this.iid); } };Rating0/0=0.00-0+
[ reply ]