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: <4035BEBA.BA2A9CC4@dessent.net> Date: Fri, 20 Feb 2004 00:00:58 -0800 From: Brian Dessent Organization: My own little world... MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: search and replace tool References: <291592011 DOT 20040218205953 AT thequod DOT de> <6 DOT 0 DOT 1 DOT 1 DOT 0 DOT 20040218151724 DOT 0398d488 AT 127 DOT 0 DOT 0 DOT 1> <40354B21 DOT 6040802 AT x-ray DOT at> <40355763 DOT E01A2710 AT dessent DOT net> <4035B0EB DOT 50003 AT corpit DOT ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Egor Duda wrote: > huh? what do you mean "in-place"? linux writes new file to new place, it > just deletes .bak file afterwards, unlike cygwin. Okay, it's not technically in-place. But perl expects to be able to do the following if you specify "-i": x = open("file"); unlink("file"); y = open("file"); read(x, ...); write(y, ...); When the program ends or the filehandles are closed, there's no further action required, such as removing the backup copy, because it's already been unlinked. Unlinking an open file is not supported by the windows filesystem (?) so this sequence is impossible. To emulate this with Cygwin, new code would have to be added that gets called after fh 'x' is closed to remove the backup copy. I'm no expert on perl internals but it sounds like this has never been done because it's nontrivial. That's all I know. I think Gerrit would be able to comment further on this. Brian -- 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/