home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!doc.ic.ac.uk!uknet!comlab.ox.ac.uk!dominic
- From: dominic@onions.natcorp.ox.ac.uk (Dominic Dunlop)
- Newsgroups: comp.lang.perl
- Subject: In-place edit works on read-only files!!!
- Message-ID: <1992Dec17.151444.14888@onionsnatcorp.ox.ac.uk>
- Date: 17 Dec 92 15:14:44 GMT
- Sender: dominic@natcorp.ox.ac.uk (Dominic Dunlop)
- Organization: British National Corpus, Oxford University, GB
- Lines: 14
- Originator: dominic@onions.natcorp.ox.ac.uk
-
- If I
- perl -p -i -e 's/\bslug\b/snail/g' *.c
-
- or whatever, it replaces files with edited versions thereof, even if
- the files are read-only. I know why this happens, and I know in-
- place editing without back-ups is probably Not A Good Idea, but I'd
- say it was slightly buggy behaviour. What does anybody else think?
-
- (FWIW, perl 4.035, SPARC, SunOS 4.1.1, Sun CC 1.1)
-
- (No, I didn't lose any data. I was mucking about with copies precious
- files, not the real thing.)
- --
- Dominic Dunlop
-