Front page | perl.beginners |
Postings from May 2002
RE: Serious problem with perl -pi -e
Thread Previous
|
Thread Next
From:
Sharan Hiremath
Date:
May 5, 2002 22:36
Subject:
RE: Serious problem with perl -pi -e
Message ID:
7CFD7CA8510CD6118F950002A519EA3055AEC5@leonoid.in.ishoni.com
Thanks a log Shawn,
But setting of this variable, now (after installation), will it be helpful.
Thanks and Regards
Sharan Hiremath.
-----Original Message-----
From: Shawn [mailto:core@enodev.com]
Sent: Tuesday, April 30, 2002 11:21 PM
To: Sharan Hiremath
Cc: beginners@perl.org
Subject: Re: Serious problem with perl -pi -e
On 04/30, sharan said something like:
> Hello Peter,
>
> I did this on Cygwin. I followed the same steps as mentioned by you. But
> still file got deleted.
>
> sharan@SHARAN ~
> $ cat foo
> cat: foo: No such file or directory
So far so good.
> sharan@SHARAN ~
> $ echo "foo" > foo
>
> sharan@SHARAN ~
> $ chmod 400 foo
>
> sharan@SHARAN ~
> $ ll foo
> -r--r--r-- 1 sharan None 4 Apr 30 10:39 foo
Ok...
> sharan@SHARAN ~
> $ cat foo
> foo
>
> sharan@SHARAN ~
> $ chmod 000 foo
>
> sharan@SHARAN ~
> $ cat foo
> foo
>
> sharan@SHARAN ~
> $ ll foo
> -r--r--r-- 1 sharan None 4 Apr 30 10:39 foo
This tells me that the CYGWIN environment variable does not have 'ntsec'
in it. What I do, before installation of CYGWIN, is add the CYGWIN
variable to my 2000 environment, simply set to ntsec. That way,
permissions are set through NTFS acls, and not interpolated through
cygwin's file() like method.
> sharan@SHARAN ~
> $ perl -pi -e 's/o/e/' foo
> Can't do inplace edit on foo: Permission denied.
Wierd.
> sharan@SHARAN ~
> $ cat foo
> cat: foo: No such file or directory
After the point you 'chmod 000' and 'll foo', and it still shows 444, I
have no intelligent answers.
> sharan@SHARAN ~
>
> Thanks
> Sharan Hiremath.
>
> "Peter Scott" <Peter@PSDT.com> wrote in message
> news:4.3.2.7.2.20020429094246.00ba2260@shell2.webquarry.com...
> > 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: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
>
--
Shawn Leas
core@enodev.com
In school, every period ends with a bell. Every sentence ends
with a period. Every crime ends with a sentence.
-- Stephen Wright
Thread Previous
|
Thread Next