- stat/lstat - get information about a specific file/directory (ex. see
here)
-
opendir (ex how to iterate through directory)
- open(pathname, permissions, mode), returns an FD. Permissions/flags: O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL.
- After calling read, an internal iterator is incremented so next time you call read, you read next data
- write(fd, buffer, bytesToWrite) may not always write bytesToWrite (keep trying in a while loop)
- dup2(curfd, newfd) sets newfd to the curfd