as side note, using perl you can also trap the occurence of this behaviour, if it is important in your application.
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*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
|