Home > Back-end >  With open operation in Linux file, create a non-existent file directly using O_EXCL error
With open operation in Linux file, create a non-existent file directly using O_EXCL error

Time:11-08

I use the open (filename, O_RDWR | O_EXCL | O_TRUNC, S_IRWXG) open a non-existent file error, only open files exist error, O_EXCL not to say that the file does not exist is created it, feeling O_EXCL doesn't have any effect?

CodePudding user response:

O_EXCL said if you want to create the file already exists, the error, return 1 at the same time, and modify the value of errno,
  • Related