This is perl, v5.6.1 built for cygwin-multi
$ ls -l
total 4
-rw-r--r-- 1 juffi Kein 1 Oct 10 18:01 a
-rw-r--r-- 1 juffi Kein 1 Oct 10 18:01 b
-rw-r--r-- 1 juffi Kein 1 Oct 10 18:01 c
-rw-r--r-- 1 juffi Kein 1 Oct 10 18:01 d
$ perl -i -pe 's/x/y/g' *
Can't do inplace edit on a: Permission denied.
Can't do inplace edit on b: Permission denied.
Can't do inplace edit on c: Permission denied.
Can't do inplace edit on d: Permission denied.
$ ls -l
total 0
Is this normal?
(it works fine if I do -i.bak, but real men don't need backups, right? :-) )
Juffi
> $ ls -l
> total 4
> -rw-r--r-- 1 juffi Kein 1 Oct 10 18:01 a
> -rw-r--r-- 1 juffi Kein 1 Oct 10 18:01 b
> -rw-r--r-- 1 juffi Kein 1 Oct 10 18:01 c
> -rw-r--r-- 1 juffi Kein 1 Oct 10 18:01 d
>
> $ perl -i -pe 's/x/y/g' *
> Can't do inplace edit on a: Permission denied.
> Can't do inplace edit on b: Permission denied.
> Can't do inplace edit on c: Permission denied.
> Can't do inplace edit on d: Permission denied.
>
> $ ls -l
> total 0
>
> Is this normal?
>
> (it works fine if I do -i.bak, but real men don't need backups, right? :-) )
perldoc perldiag
[snip]
Can't do inplace edit on %s: %s
(S inplace) The creation of the new file failed for
the indicated reason.
Can't do inplace edit without backup
(F) You're on a system such as MS-DOS that gets con
fused if you try reading from a deleted (but still
opened) file. You have to say `-i.bak', or some such.
John
--
use Perl;
program
fulfillment
Thanks, I did not know that.
But even if I had known it, I would have assumed that -i simply does not
work on Windows systems. This gives absolutely no indication that it
will delete my files! Shouldn't there at least a big warning somewhere,
or better, an implementation that refuses to use -i on an OS where it can't?
Juffi
>> Can't do inplace edit without backup
>> (F) You're on a system such as MS-DOS that gets con
>> fused if you try reading from a deleted (but still
>> opened) file. You have to say `-i.bak', or some such.
>
> Thanks, I did not know that.
>
> But even if I had known it, I would have assumed that -i simply does not
> work on Windows systems. This gives absolutely no indication that it
> will delete my files! Shouldn't there at least a big warning somewhere,
> or better, an implementation that refuses to use -i on an OS where it can't?
So you want to retract that "but real men don't need backups" now?
:-)
When you decided to use "bare" -i, you knew you were entering
dangerous territory. You went anyway.
But a warning wouldn't hurt either.
--
Tad McClellan SGML consulting
ta...@augustmail.com Perl programming
Fort Worth, Texas
It sounded like his problem is that he didn't get this message,
when he should of, rather it just went ahead and munged his files.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service
Sure.
[ For what it's worth: I did have a backup. :-) ]
> When you decided to use "bare" -i, you knew you were entering
> dangerous territory. You went anyway.
Well, I thought it was dangerous because I had no possibility of undoing
whatever changes to a file I make, not because it will kill my files.
When you use the -i switch on Linux on a regular basis, and know how to
handle it with care, you'd be *very* surprised if you try it on cygwin,
do whatever you did under Linux and suddenly your files are gone.
Juffi
Are you trying to tell me that when I am used to perl under Linux, I
should first re-read the entire documentation before I even try to type
a simple command-line substitution under a different operating system?
Perl is known to be a very safe, stable and portable system, at least it
has always been good to me. So I expect whatever works under Linux, will
most likely work under other operating systems, and if it doesn't that
it will certainly not flush my files, but give me a decent error message
that says -i doesn't work here.
Juffi