From e35b2d9617491b49cf57ca1b03e81b6522c4081d Mon Sep 17 00:00:00 2001 From: Jorge Chamorro Bieling Date: Tue, 29 Mar 2011 09:53:32 +0200 Subject: [PATCH] docs: fs.read/write() cb()s now receive buffer --- doc/api/fs.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown index 044bdd27829..6d7cd783647 100644 --- a/doc/api/fs.markdown +++ b/doc/api/fs.markdown @@ -227,8 +227,8 @@ should be written. If `position` is `null`, the data will be written at the current position. See pwrite(2). -The callback will be given two arguments `(err, written)` where `written` -specifies how many _bytes_ were written. +The callback will be given three arguments `(err, written, buffer)` where `written` +specifies how many _bytes_ were written into `buffer`. Note that it is unsafe to use `fs.write` multiple times on the same file without waiting for the callback. For this scenario, @@ -257,7 +257,7 @@ Read data from the file specified by `fd`. `position` is an integer specifying where to begin reading from in the file. If `position` is `null`, data will be read from the current file position. -The callback is given the two arguments, `(err, bytesRead)`. +The callback is given the three arguments, `(err, bytesRead, buffer)`. ### fs.readSync(fd, buffer, offset, length, position)