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: <002901c4e0cc$63809d60$5709a443@c40624a> From: "Raye Raskin" To: "Ben Wing" , References: <010201c4e0ac$62abcec0$210110ac AT NEEEEEEE> Subject: Re: How to make `mv the hard way' fail Date: Sun, 12 Dec 2004 20:29:51 -0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-IsSubscribed: yes > When I use `mv' on a directory and any file within it happens to be locked > for some reason [e.g. I've opened it in Word], it will try to copy the > entire directory and then delete the original. > > I consider this very dangerous behavior to be happening without my > specifically requesting it, and I'd like to make this fail rather than doing > this. Is there any option in Cygwin to disable this? Usually it is very > easy to fix the problem, but I want to be told about it rather than having > to ^C the mv and hope I caught it before it was in the middle of deleting > the original. > > Thanks. > > ben If you have enough disk space you could do "cp -pr FROM TO" followed by "rm -rf FROM" if there are no errors reported by the cp command. You could do a "diff -qr FROM TO" before the rm to feel even safer. You could even write a little shell script that does the above, name it mv, and put it in /usr/local/bin or some other place that comes before mv.exe in your path. If you really wanted to, that is. Raye. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/