'chflags' on a symbolic link file?

Andrey Simonenko simon at comsys.ntu-kpi.kiev.ua
Wed Apr 9 01:08:44 PDT 2003


On Wed, 9 Apr 2003 06:07:13 +0000 (UTC) in lucky.freebsd.questions, Mark wrote:
> Hello again,
> 
> Perhaps a dumb question, but can I do a 'chflags' on a symbolic link file?
> (FreeBSD 4.7R). Not the destination of the link, but the actual link file
> itself. The reason I ask, is that I want to prevent a symbolic link from
> being deleted.
> 

Read last paragraph from the chflags(1) manual page, it answers
your question:

     Symbolic links do not have flags, so unless the -H or -L option is set,
     chflags on a symbolic link always succeeds and has no effect.  The -H, -L
     and -P options are ignored unless the -R option is specified.  In addi-
     tion, these options override each other and the command's actions are
     determined by the last one specified.


More information about the freebsd-questions mailing list