This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: perl and problem with in-place edits (just deletes files) on Cygwin 1.3.10 on Win98


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]