This is the mail archive of the cygwin 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: search and replace tool


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@paltus:~$ echo aaa >xxx
> deo@paltus:~$ ls -i xxx
>  408096 xxx
> deo@paltus:~$ perl -i -pe 's/aaa/bbbb/' xxx
> deo@paltus:~$ ls -i xxx
>  408074 xxx
> deo@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/


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