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 X-Server-Uuid: C7B63A7D-B711-4BF3-AF47-0E6C663E1461 Sensitivity: Subject: Re: Bug in rm -r with locked files To: "Randall R Schulz" cc: cygwin AT cygwin DOT com From: Brian DOT Kelly AT empireblue DOT com Date: Tue, 21 Jan 2003 14:42:09 -0500 Message-ID: MIME-Version: 1.0 X-WSS-ID: 12337D573345815-01-05 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Note-from-DJ: This may be spam Interesting - It's more important to "force" a square into a circle and uphold a "standard" than it is to deliver common sense "usability". MSWin is inherently "UN-posix" by nature, and while I applaud trying to make a "silk (posix) purse" out of it, if it means rendering the most basic of utilities fundamentally unusable - then what is the point??? As I posted earlier, I cannot use rm -rf in a script and must resort to the native "del" cmd because rm -rf hangs when it encounters a locked file. Most of the files can be recovered with either attrib or chmod xxx * and then the script can continue. But in order for that to happen, there has to be an ERROR MSG - something I can get from the MS del cmd - even though I'd rather use rm. It's all lost on me ... Brian Kelly "Randall R Schulz" @cygwin.com on 01/21/2003 02:25:19 PM Sent by: cygwin-owner AT cygwin DOT com To: cygwin AT cygwin DOT com cc: (bcc: Brian Kelly/WTC1/Empire) Subject: Re: Bug in rm -r with locked files Shankar, At 11:05 2003-01-21, Shankar Unni wrote: >lhall AT pop DOT ma DOT ultranet DOT com wrote: >>You may find the 'handle' utility from www.sysinternal.com a handy >>(no pun intended :-) ) tool for determining which files are opened >>by which processes. > >I don't think that was the primary issue. The issue was that if a process >is using a directory as its working directory (chdir()'ed into it), "rm >-rf" goes into an infinite loop attempting to remove the directory (rather >than print an error and move on). > >Definitely a bug, and still a bug. That, in fact, is a presumption. The Cygwin principals are aware of this behavior and it is not new. It is a trade-off required to get POSIX-like behavior from the "unlink" system call as emulated by Cygwin. Please review the discussions under the subject "Infinite Loop In "rm -fr" When Busy File Encountered" on April 6, 2002 and "REPOST: unlink semantics" from April 10, 2002. I'm not an expert, but this has come up more than once (I initiated the April 6 round of discussions) and the upshot is that given the mismatch of API semantics between Windows and POSIX, this is the best that can be done. Randall Schulz -- 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/ "Empire Health Choice Inc." made the following annotations on 01/21/2003 02:43:30 PM ------------------------------------------------------------------------------ [INFO] -- Access Manager: Attention! This electronic message contains information that may be legally confidential and/or privileged. The information is intended solely for the individual or entity named above and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Release/Disclosure Statement -- 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/