| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Date: | Mon, 1 Jul 2002 13:12:32 +0800 |
| From: | Greg Matheson <lang AT ms DOT chinmin DOT edu DOT tw> |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: perl and problem with in-place edits (just deletes files) on Cygwin 1.3.10 on Win98 |
| Message-ID: | <20020701131231.C78450@ms.chinmin.edu.tw> |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| References: | <afghkl$34n$1 AT main DOT gmane DOT org> |
| Mime-Version: | 1.0 |
| User-Agent: | Mutt/1.2.5i |
On Thu, 27 Jun 2002, Max wrote:
> Ran this command the other day in a directory with C files
> perl -p -i -e 's/string1/string2/g' *c
> Got a long list of
> Can't do inplace edit on name.c: File exists.
> At the end of it, all the .c files were deleted
According to this thread, perl opens the file for reading in
place, unlinks it (the unlink is queued by cygwin), opens a same
name file for writing, gets a Windows error message that file
exists, and so can't write and the operation is canceled. The
unlink is not canceled however, and so the file is deleted.
http://sources.redhat.com/ml/cygwin/2001-08/msg00404.html
--
Greg Matheson Teaching: computer programming
Chinmin College done by monkeys.
Taiwan Penpals Archive <URL: http://netcity.hinet.net/kurage>
--
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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |