* transcribe [ - ] [ -delay ] file
* watch a file and copy it out
* as it grows. default interval for
* option - suppresses complete file from being copied out
* and only gives new stuff.
if (argc
> 1 && argv
[0][0] == '-' && argv
[0][1] == 0) {
if (argc
> 1 && argv
[0][0] == '+') {
timeleft
= getdel(argv
[0] + 1);
if (argc
> 1 && argv
[0][0] == '-') {
interval
= getdel(argv
[0] + 1);
printf("Usage: %s [ - ] [ -interval ] file\n", progname
);
printf("Unreasonable interval\n");
if (open(argv
[0], 0) < 0) {
if (stbuf
.st_size
> offset
) {
lseek(0, (long) offset
, 0);
while ((i
= read(0, buf
, sizeof buf
)) > 0) {
j
= j
* 10 + *cp
++ - '0';
if (c
< '0' || c
> '9') {
printf("Bad number for interval\n");