diff options
author | Roland McGrath <roland@gnu.org> | 1994-05-23 23:35:24 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1994-05-23 23:35:24 +0000 |
commit | 7ea52bc1d81b6ccbeaead125db6ee98accba107b (patch) | |
tree | e0a605bb092d1feeed8a381a2d3c522bef8fc610 /stdio | |
parent | 45cc8a1ec513decfc57800840149ecf7f76e4761 (diff) |
Initial revision
Diffstat (limited to 'stdio')
-rw-r--r-- | stdio/xbug.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/stdio/xbug.c b/stdio/xbug.c new file mode 100644 index 0000000000..9073a2dec5 --- /dev/null +++ b/stdio/xbug.c @@ -0,0 +1,21 @@ +#include <stdio.h> + +main() +{ + char * filename = "xbug.c"; + FILE *input; + int i; + char buf[256]; + + + if (!freopen (filename, "r", stdin)) + fprintf(stderr, "cannot open file\n"); + + if (!(input = popen("/bin/cat", "r"))) + fprintf(stderr, "cannot run \n"); + + + while(gets(buf) != NULL) { + fprintf(stdout, "read: %s\n", buf); + } +} |