ANSI C library implements a model of text input and output. Standard input and standard output is by default attached to keyboard or file or another program.
eg getchar(void) will get characters fom keyboard; prog < infile will input infile contents in prog program; Using Pipes: otherprog | prog channels otherprog output into prog; putchar(int) to send to output stream; prog > outfile; prog | anotherprog.
Question to myself: Does this look easy and helpful to use; and if it is, why does Java not provide this model?
Java has System.out, System.err, System.in. hummm. So we use a lot of System.out in java; we can similarly use System.err, OK. But System.in? When did I use it, don't remember. My memory is failing me or I have really never seen it used?
But certainly Java does not have < as input redirection, or | as pipe mechanism. Or am I ignorant?
No comments:
Post a Comment