This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: perl and problem with in-place edits (just deletes files) on Cygwin 1.3.10 on Win98
- From: Greg Matheson <lang at ms dot chinmin dot edu dot tw>
- To: cygwin at cygwin dot com
- Date: Mon, 1 Jul 2002 13:12:32 +0800
- Subject: Re: perl and problem with in-place edits (just deletes files) on Cygwin 1.3.10 on Win98
- References: <afghkl$34n$1@main.gmane.org>
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/