At 12:35 PM 4/27/02 +0530, sharan wrote:
>Hello,
>
>I lost my files, while using perl -pi -e.
>I wanted to replace a world in a set of files, "perl -pi -e
>'s/somestring/somethingelse/g' *.pl"
>but, it gave error saying permission denied and all the files got deleted.
>
>If it cant rewrite the files, at least it should not delete.

Can you show me how to reproduce this behavior?  Here's what happened when 
I tried, first with no write permission, then with no read permission either:

$ cat foo
cat: foo: No such file or directory
$ echo "foo" > foo
$ chmod 400 foo
$ cat foo
foo
$ perl -pi -e 's/o/e/' foo
$ cat foo
feo
$ chmod 000 foo
$ cat foo
cat: foo: Permission denied
$ perl -pi -e 's/o/e/' foo
Can't open foo: Permission denied.
$ cat foo
cat: foo: Permission denied
$ chmod 400 foo
$ cat foo
feo

As you can see, the file was not deleted.  This was on Linux, what OS were 
you on?

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to