Because you're reading file from start to end, and position changes at every read?
Cheers, Fedor. On Tue, Apr 30, 2013 at 2:15 PM, Afshin Mehrabani <[email protected]>wrote: > Sorry I didn't get it. Why should read an undefined position? or zero? > > On Tuesday, April 30, 2013 1:12:18 PM UTC+4:30, Ben Noordhuis wrote: > >> On Tue, Apr 30, 2013 at 8:08 AM, Afshin Mehrabani <[email protected]> >> wrote: >> > Just another question guys, what about opening a link to the file and >> then >> > use that link in all reads? I mean use fs.open and hold the fd >> parameter in >> > a global scope to use it in all other situations. >> > >> > Will this solution fix the problem? >> >> Yes, as long as you use positional reads: fs.read() with position >= >> 0. Non-positional reads (position=null or undefined, i.e. read from >> current offset) will give unexpected results with multiple readers. >> > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
