Worth to notice that (at least on Tiger but I think in all *nixes) if
writing to a file that exists already it overwrites it but it keeps
ownership and permissions.
Yes, that's standard UN*X behavior - open(..., O_CREAT) and creat()
will, if the file in question already exists, just open it for writing
(and truncate it in creat() or open() with O_TRUNC) without changing the
permissions.