int open(const char *path, int flags, int mode)
  • Returns the FD of the opened file
  • mode only in use depending on flags

Example

int fd = open("sample.txt", O_RDWR | O_CREAT, 0644); // read write, and create if not already created