Skip to content

v6.13.1 createReadStream() invalid seek #19240

Closed
@wankdanker

Description

@wankdanker

It believe commit 82bdf8f (fs: fix options.end of fs.ReadStream()) broke my code for creating a read stream. It looks to me like this.start is now forced to the value 0 whereas previously it was allowed to be undefined. I'm guessing since it is 0 it now forces a seek operation which breaks my use case.

In v6.13.1, this code:

var fs = require('fs');
var reader = fs.createReadStream('/dev/ttyS0');

results in this error:

Error: ESPIPE: invalid seek, read
    at Error (native)

The above code in v6.13.0 does not create that error.

In v6.13.0, this code:

var fs = require('fs');
var reader = fs.createReadStream('/dev/ttyS0', { start : 0 });

results in this error:

Error: ESPIPE: invalid seek, read
    at Error (native)

Metadata

Metadata

Assignees

Labels

fsIssues and PRs related to the fs subsystem / file system.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions