int open(const char *pathname, int flags);
int open(const char *pathname, int flags, mode_t mode);
int creat(const char *pathname, mode_t mode);
fd = open(pathname, O_WONLY | O_CREAT | O_TRUNC, mode);
ssize_t read(int fd, void *buf, size_t count);
// mostly a book example, sorry
char buffer[MAX_READ+1];
ssize_t numRead;
numRead = read(STDIN_FILENO, buffer, MAX_READ);
if (-1 == numRead) {
perror("Read Failed");
exit(0);
}
buffer[numRead] = '\n';
...
ssize_t write(int fd, const void *buf, size_t count);