Answers for "O_CREAT open"

0

O_CREAT open

int fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0644);
if ((fd == -1) && (EEXIST == errno))
{
    /* open the existing file with write flag */
    fd = open(path, O_WRONLY);
}
Posted by: Guest on December-13-2020

Browse Popular Code Answers by Language