#include #include #include #include #include #include int main(int argc, char *argv[]) { int fd; char line[100]; int n; int pos; fd = open("textFile", O_RDONLY); n = read(fd, &line[0], 10); line[n] = '\0'; cout << "Data read = `" << line << "'" << endl; pos = lseek(fd, 2, SEEK_SET); cout << "New position = " << pos << endl; n = read(fd, &line[0], 10); line[n] = '\0'; cout << "Data read = `" << line << "'" << endl; pos = lseek(fd, -20, SEEK_END); cout << "New position = " << pos << endl; n = read(fd, &line[0], 10); line[n] = '\0'; cout << "Data read = `" << line << "'" << endl; }