delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/02/20/03:01:30

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <brian AT dessent DOT net>
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> <Pine DOT GSO DOT 4 DOT 56 DOT 0402191929000 DOT 22216 AT slinky DOT cs DOT nyu DOT edu> <40355763 DOT E01A2710 AT dessent DOT net> <Pine DOT GSO DOT 4 DOT 56 DOT 0402191952150 DOT 22216 AT slinky DOT cs DOT nyu DOT edu> <4035B0EB DOT 50003 AT corpit DOT ru>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019