スクリプトで作ってみた。
まだまだ検討の余地がありそうだけど、第一版をUP。
//tail for windows.
//please select "Cscript" engine.
//Created by sashimi.
var looptime;
var path;
if(WScript.Arguments.length==0
|| WScript.FullName.substr
(WScript.FullName.length-11).toUpperCase()=="WSCRIPT.EXE"){
WScript.Echo("Usage:cscript tail.js");
WScript.Quit(1);
}
path=WScript.Arguments(0);
//WScript.echo(path);
var fso=WScript.CreateObject("Scripting.FileSystemObject");
if(!fso.fileExists(path)){
fso=null;
WScript.Quit(1);
}
var ts=fso.OpenTextFile(path,1,false);
var size=fso.GetFile(path).Size;
//WScript.Echo(size);
ts.Skip(size);
try{
while(true){
WScript.Sleep(1000);
if(!ts.AtEndOfStream){
WScript.Echo(ts.ReadLine());
}
}
}catch(e){
}finally{
ts=null;
fso=null;
}