Yeah. I decided a while ago not to match node's api. I like the feel of the
object model better and it provides the possibility of creating streams
from different sources that work together. Like piping a file to a serial
port or over a socket connection.
 On Apr 20, 2014 1:46 PM, "Rick Waldron" <notifications@github.com> wrote:

> In tests/test_FS_API_1_Read.js:
>
> > @@ -0,0 +1,7 @@
> > +// read and write both take a number of bytes and position as the second and third arguments.
> > +// 0 is a valid position, so -1 is used to indicate "don't care" or "current position".
> > +var fd = require("fs").open('./tests/FS_API_Test.txt','r');
> > +var buffer="";
> > +fd.read(buffer,6,22);
>
> If this API is supposed to match Node.js, this should be fs.read(fd,
> buffer, 6, 22);
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/espruino/Espruino/pull/333/files#r11799316>
> .
>