Mail Archives: cygwin/2002/07/01/01:07:36
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/
- Raw text -