Closed tshinnic closed 13 years ago
This always returns two args, even in the flock() case.
Wouldn't it be better to add a flag to store_data_t to say what call we're doing here (and an enum of call types) and deal with it appropriately?
It would be more precise, and would allow more flexibility for future work, sure. But I was trying for "minimum change". (habit)
I'll go do that later, as I start to do utime(), which is even more fun on the input arguments.
On Wed, Jun 15, 2011 at 10:56 AM, baudehlo < reply@reply.github.com>wrote:
This always returns two args, even in the flock() case.
Wouldn't it be better to add a flag to store_data_t to say what call we're doing here (and an enum of call types) and deal with it appropriately?
Reply to this email directly or view it on GitHub: https://github.com/baudehlo/node-fs-ext/pull/2#issuecomment-1374655
Somewhat icky change to how values are returned to callbacks in the After() routine in fs-ext.cc Problem is that we don't have anything easy to switch on to determine when to return something more than the 'err' value. So change just always returns 'result' as the second argument to callbacks. (Note we don't have to worry about result colliding with the error value of -1 as lseek() would not return a negative position) Another option would be to have an "After2" routine that would always return err&result, leaving After() alone to return just err. Icky...
I've updated the README.md to mention seek() now returning the current file position.