Added logic to not fail if open file with O_CREAT