Subject: infinite loop in rm -fr (revisited)
From: Joe Buehler <[email-masked]>
To: [email-masked]
Date: Tue, 02 Jul 2002 15:05:16 -0400
Newsgroups: gmane.os.cygwin

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/