alias flushlog {
var %flush.active = $iif($1,$1,$active), %flush.path.1 = $window(%flush.active).logfile, %flush.path.target = $gettok($nopath(%flush.path.1),1,46), %flush.path.2 = $mklogfn(%flush.path.target)
var %flush.color = $color(Info Text), %flush.isfile.1 = $isfile(%flush.path.1), %flush.isfile.2 = $isfile(%flush.path.2)
if (%flush.isfile.1 && %flush.isfile.2) {
.copy -a $qt(%flush.path.1) $qt(%flush.path.2)
remove $qt(%flush.path.1)
}
echo %flush.color -ae * $iif(!%flush.isfile.1 && !%flush.isfile.2,/flushlog: file not found,Flushed log: %flush.active)
}
alias viewlog {
var %view.active = $iif($1,$1,$active), %view.path.1 = $window(%view.active).logfile, %view.path.target = $gettok($nopath(%view.path.1), 1, 46), %view.path.2 = $mklogfn(%view.path.target)
var %view.isfile.1 = $isfile(%view.path.1), %view.isfile.2 = $isfile(%view.path.2)
flushlog %view.active
$iif(%view.isfile.2,run $qt(%view.path.2),$iif(%view.isfile.1,run $qt(%view.path.1),echo $color(Info Text) -ae * /viewlog: file not found))
}