Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <003e01c2c1ac$70354470$3300a8c0@nakagami> From: "Carlo Florendo" To: References: <3E2D33FA DOT 5090200 AT polyspace DOT com> Subject: Re: Bug in rm -r with locked files Date: Wed, 22 Jan 2003 09:23:05 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4920.2300 Hi Gael, This is not a bug. rm will *not* be able to remove the file as long as it is locked. This is the expected behaviour of rm when it is trying to remove something which is locked by windows. AFAIK, rm, in cases such as these, echoes an error message which says, for example: "rm: cannot remove `/tmp/directory/.file.swp': Permission denied" and not go on infinite loop. Why rm went on an infinite loop is another matter, but the gurus here can help you if you give more details. Regards, Carlo -------------------- Carlo Florendo Astra Philippines Inc. email: carlo AT astra DOT ph URL: http://www.astra.ph ----- Original Message ----- From: "Gael Mulat" To: Sent: Tuesday, January 21, 2003 8:50 PM Subject: Bug in rm -r with locked files > Hi, > > This is a bug report about rm (package fileutils, version 4.1-1) on W2K. > > Test case: take 2 cygwin shells. > shell 1: > mkdir /tmp/directory > vi /tmp/directory/file > > shell 2: > /bin/rm -rf /tmp/directory > > The shell2 doesn't manage to remove the directory and goes into an > infinite loop, taking 100% of the CPU. > All is then OK if we go out of vi in the shell1. > > Doing the same thing (deleting the directory) directly in Windows > produces an error message: "cannot delete directory: Access is denied. > The source file may be in use" and we can notice in the directory a file > named .file.swp that is also visible under Cygwin with ls -la. > > The example I have just given uses vi, but it is the same with all > processes that open the file, as W2K puts a lock on it. > > Gael Mulat > > > > > -- > 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/ > > -- 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/