On Sat, Jun 19, 2021 at 12:42:14PM +0000, Al Viro wrote: > On Sat, Jun 19, 2021 at 06:01:48AM -0500, Arthur Williams wrote: > > Make opening a file with the O_CREAT flag a no-op if the specified file > > exists even if it exists as a directory. Allows userspace commands, like > > flock, to open a file and create it if it doesn't exist instead of > > having to parse errno. > > Not going to happen. It's a user-visible behaviour, consistent between > all kinds of Unices, consistent with POSIX and it does make sense. > > NAK. Agreed. POSIX states: [EISDIR] The named file is a directory and oflag includes O_WRONLY or O_RDWR, or includes O_CREAT without O_DIRECTORY. so I would say the POSIX committee considered this situation and explicitly did not want it to succeed.