[aklug] Re: Linux/BSD: Why do directories need to be empty?

From: Ken Weinert <kenw@quarter-flash.com>
Date: Fri May 27 2011 - 08:27:10 AKDT

On 5/26/2011 8:59 PM, Christopher Howard wrote:
>
> What started this whole thread is that I tried to use rm -rf on a
> directory, and the command failed because there was a file in one
> sub-directory that was read only.
>
Most likely because the execute permission is required in order to
search. And if you can't search then you can't find the
files/directories in the directory in order to keep recursing and removing.

A script that changed permissions on the directories in a tree prior to
removing could be useful here. Just be sure to check the return from the
chmod command in order to know if any of the directories couldn't be
modified.

-- 
Ken
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri May 27 08:27:17 2011

This archive was generated by hypermail 2.1.8 : Fri May 27 2011 - 08:27:17 AKDT