Quoting Dag-Erling Smørgrav <[EMAIL PROTECTED]> (from Wed, 16 May 2007 10:18:40 +0200):

Alexander Leidinger <[EMAIL PROTECTED]> writes:
What about another idea: removing the chflags all together and let the
removal fail (with a message that the file may be protected with schg
and it should be removed with chglags). This way only a message
appears when the rm fails (saying no to the removal question of rm is
not a failure/exit!=0).

OK with me.

BTW, testing for the schg flag is not straightforward, but doable:

        flags=$(stat -f '%f' ./$${file})
        if [ $((flags & 131072)) -eq 131072 ] ; then
                # schg is set
        fi

This does not cover the case when the user doesn't want to remove the file. So I think removing the chflags is better than testing for the flag.

Bye,
Alexander.

--
Anyone can hold the helm when the sea is calm.
                -- Publilius Syrus

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to