[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: reverting changes to svn-base files

From: John Peacock <jpeacock_at_rowman.com>
Date: 2004-05-03 21:59:25 CEST

Jonathan Manning wrote:

> perl -pi -e 's/string1/string2/' *
>
> All files changed, despite being read-only.

Inplace edits work something like this:

        1) copy source file to new temporary name
        2) edit temporary file
        3) rename temp file to original filename

Step #1 makes the new file writeable; step #3 succeeds because that depends on
the containing directory rights, not the file protections on the original file.
  You can confirm this by using "-i.bak" and seeing that the .bak files are
still marked as readonly.

HTH

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon May 3 21:59:44 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.