#include #include #include #include using namespace std; int main() { int fd; int flags; char c; flags = O_RDONLY; fd = open("holeFile",flags); while (0 != read(fd,&c,sizeof(char))) { if (c != 0) { cout << "Just got a " << c << endl ; } else { cout << "hole" << endl; } } close(fd); return 0; }