#include #include using namespace std; #include #include #include #include main(int argc, char **argv) { int fd = open(argv[1], O_RDONLY); if(fd < 0) cerr << "File open failed." << endl; else { char buf[1024]; int nchr; while((nchr = read(fd, buf, sizeof buf)) > 0) cout.write(buf, nchr); } }