diff options
Diffstat (limited to 'slowcat.c')
-rw-r--r-- | slowcat.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/slowcat.c b/slowcat.c deleted file mode 100644 index facd2cc..0000000 --- a/slowcat.c +++ /dev/null @@ -1,28 +0,0 @@ -#define _BSD_SOURCE -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> - -int main(int argc,char *argv[]) { - short in; - FILE *fp=stdin; - if(argc < 2) { - fprintf(stderr,"usage: slowcat delay [file1] [file2] [...]\n"); - return 1; - } - if(argc > 2) { - fp=fopen(argv[2],"r"); - } - do { - while((in=fgetc(fp)) != -1) { - printf("%c",in); - if(in == '\n') { - fflush(stdout); - usleep(atoi(argv[1])); - } - } - fclose(fp); - argv++; - } while((fp=fopen(argv[1],"r"))); - return 0; -} |