From: apeiros@... Date: 2009-11-09T22:00:47+09:00 Subject: Re: FileString - request for comments -------- Original-Nachricht -------- > Datum: Mon, 9 Nov 2009 12:37:17 +0900 > Von: James Edward Gray II > An: ruby-talk@ruby-lang.org > Betreff: Re: FileString - request for comments > On Nov 8, 2009, at 7:47 PM, apeiros@gmx.net wrote: > > > I just put FileString on github: http://github.com/apeiros/filestring > > FileString is a class that wraps a path on the filesystem (a file) > > and provides an exact copy of the String API. This means you can > > code as if you had a String and your file on the disk gets > > manipulated just "magically". > > Interesting choice to use a String. I used Tie::File a couple of > times in Perl code. It works as an Array instead: > > http://search.cpan.org/~mjd/Tie-File-0.96/lib/Tie/File.pm > > James Edward Gray II Somebody I know already implemented a TieFile in ruby, the repository is at http://killerfox.protection-fault.ch/gitrepo/tie_file.git Personally I don't tend to think of a file as an array. I'd use Tie::File if I'd need a persistent array, so the problem is coming "the other way round". With FileString I explicitly want to deal with a File, but not with an IO like API (of course you could go at it as "I need a persistent String" too - but that wasn't/isn't the case for me). Regards Stefan -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser