Open a file for reading
int fd; fd = open("foo.txt", O_RDONLY, 0);
Open an existing file for writing (current data is first truncated to 0 bytes) with permissions
- owner: read/write
- group: read/write
- other: read/write
int fd; fd = open("foo.txt", O_WRONLY, 0666);