Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
To: cygwin@cygwin.com
X-Injected-Via-Gmane: http://gmane.org/
Path: not-for-mail
From: Joe Buehler <jbuehler@hekimian.com>
Newsgroups: gmane.os.cygwin
Subject: infinite loop in rm -fr (revisited)
Date: Tue, 02 Jul 2002 15:05:16 -0400
Lines: 19
Message-ID: <3D21F96C.50603@hekimian.com>
NNTP-Posting-Host: hekimian.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: main.gmane.org 1025636685 5755 206.205.138.10 (2 Jul 2002 19:04:45 GMT)
X-Complaints-To: usenet@main.gmane.org
NNTP-Posting-Date: Tue, 2 Jul 2002 19:04:45 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.0) Gecko/20020530
X-Accept-Language: en-us, en

There was a thread back in April on this topic and I would like to know
whether it was ever resolved.

The following script will demonstrate the infinite loop:

#!/bin/bash
trap "cd /; rm-orig -fr /tmp/xxx.dir" 0
mkdir /tmp/xxx.dir
exec >/tmp/xxx.dir/info

The problem appears to be that "info" stays in the directory
even though it has been deleted (presumably because the script
has the file open).

Seems like the general solution is to move the file elsewhere before
deleting it.  Perhaps to a reserved directory on the root of the drive?

Joe Buehler




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

