On Dec 4, 2007 12:11 PM, Paul F. [email protected] wrote:
Robert D. wrote:
ruby -i.bup source.rb file1, …
thanks for the reply the -i flag looks like it’ll be useful, but in my
current situation, i need to be able to do it via an instance method,
rather than command line.
I fail to understand, can you elaborate on the calling environment?
Assuming that you cannot use the -i flag I would be tempted to read
the file into memory or use tempfile to create a copy of the original
file and than open the original file with write access (“w”), if this
is not feasible either I would (as a last resort ) go for read-write
access, this is quite messy at least FWIAC :(.
Hopefully somebody else can give you (us) better information about
that particular issue.
i guess i could call system() to do it, but tht doesn’t seem right?
Posted via http://www.ruby-forum.com/.
All truth passes through three stages. First, it is ridiculed. Second,
it is violently opposed. Third, it is accepted as being self-evident.