ellacochran/node — comment on commit a6fbf74351d3f13531f0d4676b726b2b8d2a463e
File: lib/fs.js line 1005
By ellacochran:

Why?

{pauseonend:true, start:42} would mean: read the file from position 42 and pause at the end instead of closing
{pauseonend:true, start:42, end:1337} would mean read the file from position 42 until position 1337

The first has a non deterministic end-point in that the file may grow.
The second has a determined end-point. I don't want any data after position 1337.

If the fs.ReadStream were to be completely redefined, then I would choose the semantics:

{ start:x } -> means read from position x (default 0) and pause at the and since more data may yet arrive
{ start:x, end:y } -> means read from position x to position y and then end
{ start:x, end:-1 } -> means read from position x (default 0) to EOF and then end

So start can be undefined or a position in which case the stream never ends.
end can be undefined, -1 or a number which means (in order) never end, EOF or a position within the file. If end is specified to be larger than the size of the file it would pause at current EOF and end when explicitly called (destroy) or once the file has grown to the point where EOF > end.

But that would basically kill all current uses in modules and so on, since it would now me obligatory to pass { end: -1 } as an option to ever fs.ReadStream. So it's probably not a very good idea.