coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [wishlist] rm -rf to alter directories permissions if necessary


From: Yaroslav Halchenko
Subject: Re: [wishlist] rm -rf to alter directories permissions if necessary
Date: Sat, 31 Jan 2015 22:24:08 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, 31 Jan 2015, Bob Proulx wrote:

> > although at times fs not really an issue, but I am testing git-annex
> > repositories with up to a million of files.  Thus running both first
> > recursive chmod and then rm -r sounds (and feels) quite wasteful.

> I am aware of git-annex but not really familiar with it.  However I
> don't think it is a property of git-annex to chmod -w the files.  That
> is happening at another step, no?  What is actually causing your
> directory tree to be read-only?  

It is a feature of git-annex:  it explicitly chmods directories
containing the load to avoids files accidental removal.  So they are
chmod'ed intentionally for good.   It is just that I am experimenting so
requiring creating/removal of those annex'ed repositories, and inability
to remove those repositories in a single traversal is somewhat annoying
when it takes notable time to even simply traverse that file hierarchy.
And then it is not that all directories/files are chmod -w -- so by
'chmod -R +w .git/annex/objects' I am actually causing chmod considering
files which I do not care to +w for.

> If you are trying to make something
> more convenient and don't want the tree to be read-only then not
> changing the permissions to be read-only is the right place to do it.

not a choice for me here ;)

> > So I wondered to suggest/ask if implementing alternation of the
> > parent's directory permissions if --force would be provided be a
> > sensible extension to rm?

> Long standing use has been that removing write capability from
> directories prevents files from being removed from the directory.
> Even when using rm -rf.  Changing that would create the exact opposite
> and valid bug report that 'rm -rf' removed files from write protected
> directories.  Worse that would be a data loss event.  rm is not
> allowed to chmod directories first.

yeah -- I hear you, rm -rf behavior shouldn't change for sure,  but e.g.
rm -rF could really force things ;)


-- 
Yaroslav O. Halchenko, Ph.D.
http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
Research Scientist,            Psychological and Brain Sciences Dept.
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        



reply via email to

[Prev in Thread] Current Thread [Next in Thread]