File: relog.tf

package info (click to toggle)
tf5 5.0beta8-4
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 3,380 kB
  • ctags: 2,658
  • sloc: ansic: 25,492; perl: 103; makefile: 81; sh: 79
file content (16 lines) | stat: -rw-r--r-- 452 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
;;; relog - recall into a log
; syntax:  /relog <file> <recall_arguments>
; Starts logging, and silently performs a /recall into the log file.

/loaded __TFLIB__/relog.tf
/require textutil.tf

/def -i relog = \
    /let out=%; \
    /if ((out:=tfopen({1}, "a")) < 0) /return 0%; /endif%; \
    /echo -e %% Recalling to log file %1%;\
    /test tfflush(out, 0)%; \
    /quote -S -decho #%-1 %| /copyio i %out%; \
    /test tfclose(out)%; \
    /log %1