Setting up file flags automatically

Is it possible to automatically set flags for certain files created at certain place the moment they are created?

For instance
Code:
#chflags -R sunlnk /somedir
will make all files undeletable under that dir; but can it be done the moment file is created?
 
chflags are not inherited, so when a parent directory has chflags set, files created in it will not inherit those flags. Note that in the case of some flags (e.g. schg), creating files in that directory would become impossible anyway .. Setting up a cron job would be your best best.
 
Back
Top