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 Date: Thu, 19 Feb 2004 23:51:10 -0800 From: Yitzchak Scott-Thoennes To: cygwin AT cygwin DOT com Subject: Re: search and replace tool Message-ID: <20040220075109.GA132@efn.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4035B0EB.50003@corpit.ru> User-Agent: Mutt/1.4i Organization: bs"d X-IsSubscribed: yes Note-from-DJ: This may be spam On Fri, Feb 20, 2004 at 10:02:03AM +0300, 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. > > deo AT paltus:~$ echo aaa >xxx > deo AT paltus:~$ ls -i xxx > 408096 xxx > deo AT paltus:~$ perl -i -pe 's/aaa/bbbb/' xxx > deo AT paltus:~$ ls -i xxx > 408074 xxx > deo AT paltus:~$ cat xxx > bbbb That doesn't ever create a backup file or a temporary file. It opens xxx for read, unlinks it, opens xxx for writing, then reads from the original handle and writes to the second handle. This is AFAIUI impossible on windows, but possible on things like unix and VMS (where the unlink is skipped because of the automatic versioning). -- 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/