in reply to open() and permissions not quite as documented?
sysopen MODE and combination of them, can be used in order to track the overwrite:
O_WRONLY|O_CREAT # possible rewrite of an existing file O_WRONLY|O_CREAT|O_EXCL # only create new file (fails if file exists +)
With sysopen you can also specify PERM in octal to be applied to the new created file. If not specified 0666 is the default. Then umask will be applied.
L*
|
|---|