according to the rio-docs I would expect it to be possible to edit a file
on-the-fly; for example, I tried to make a copy of /etc/passwd with my own
name (wybo) replaced with XXXX:
according to the rio-docs I would expect it to be possible to edit a file
on-the-fly; for example, I tried to make a copy of /etc/passwd with my own
name (wybo) replaced with XXXX:
that helped indeed, thanks, but is it not in contradiction to rio's
description of sub?:
sub(re,string)
Create a new Rio referencing the result of applying String#sub to the
value returned by Rio#to_s. So:
ario.sub(re,string)
is equivelent to
rio(ario.to_s.sub(re,string))
···
On Fri, 2 Dec 2005, Gavin Sinclair wrote:
Wybo Dekker wrote:
> according to the rio-docs I would expect it to be possible to edit a file
> on-the-fly; for example, I tried to make a copy of /etc/passwd with my own
> name (wybo) replaced with XXXX:
>
> rio('/etc/passwd').gsub(/wybo/,'XXXX') > rio('new')
>
> but the resulting file "new" is an exact copy of /etc/passwd.
> What am I doing wrong?