Reading fs.read and fs.write, it seems that in Node.js no interface to the C function lseek is directly exposed; the current file descriptor position can be changed right before any fs.read
or fs.write
by the argument position
.
I strongly suspect that, at low level, the argument position
is handled with an lseek
call before the read or write operation, but what about the return value of lseek
?
To be more specific, to get the current file descriptor position in C, I can write:
int position = lseek(fd, 0, SEEK_CUR);
Is there a way in Node.js to get the same information?