www.delorie.com/archives/browse.cgi | search |
> On Tue, Jul 31, 2001 at 11:18:31AM -0400, Charles Wilson wrote: >> I could probably whip up a perl (or shell) script to >> do this -- but: what cygwin command can I use to turn off "inherit from >> parent" or "propagate to child" behavior on an existing directory? Not >> "chmod 0xxx" is it? > > It would be a combination of a chmod which changes the permissions > to _anything_ different to the current setting and then a chmod > which reverts to the current setting. As I mentioned, that's > needed due to the fact that chmod is so _incredible_ clever. so the following *should* do the trick (assuming mktemp exists, of course). I'm only concerned with removing "inheritance" from a single parent directory. #!/bin/sh foo=`mktemp -d /tmp/ggXXXXXX` if [ -d ${foo} ] ; then if [ -d $1 ] ; then chmod --reference=$1 ${foo} # save old value chmod 0777 $1 # hopefully this is different chmod --reference=${foo} $1 # restore old value fi rmdir ${foo} fi --Chuck
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |