#include<stdio.h>
#include<fcntl.h>
#include<unistd.h>
#include<sys/stat.h>

int main(int argc, char * argv[]){
	int fdout = open("a2b", O_WRONLY);
	int fdin = open("b2a", O_RDONLY);

	char buf[1024];
	for (;;) {
		ssize_t n;
		write (STDOUT_FILENO, "> ", 2);
		n = read(STDIN_FILENO, buf, 1024);
		write (fdout, buf, n);
		n = read(fdin, buf, 1024);
		write (STDOUT_FILENO, buf, n);
	}
}
