matz / zetabits.com (Yukihiro Matsumoto) writes:

> Hi,
> 
> In message "[ruby-talk:9484] Re: reading an entire file as a string"
>     on 01/01/18, Dave Thomas <Dave / PragmaticProgrammer.com> writes:
> 
> |> How about IO::read(path[,size[,offset]]), where offset is the optional
> |> position to start reading?
> |
> |Sounds good. Will File#read change too?
> 
> I think it won't.  there cannot be "initial offset" for each
> invocation of IO#read.  Do you think you need "pre-read skip offset"
> for IO#read?

Personally, I think it's go for consistency here. If you treated the
offset as an absolute seek (SEEK_SET), then it might be useful for
reading fixed-record length files. The main benefit though would be
the consistent handling of parameters between the instance method and
the class method.


Dave