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" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > 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]
> 
--
Shawn Leas
[EMAIL PROTECTED]

In school, every period ends with a bell.  Every sentence ends
with a period.  Every crime ends with a sentence.
                                                -- Stephen Wright

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

Reply via email to