Ruby equivalent of Tie :: FIle?

Is there an equivalent Ruby Perl Tie :: File module ?

+4
source share
1 answer

No.

It is easy to read the file and return the lines as Array , as in Perl:

 array = File.readlines("testfile") 

But I don’t think there is a library that guarantees that all operations on Array are reflected in the source file (or more efficient for large files than the naive approach above).

+2
source

All Articles