summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorChandra Sekar S <chandru.in@gmail.com>2010-07-20 18:16:27 +0530
committerRyan Dahl <ry@tinyclouds.org>2010-07-21 11:33:35 -0700
commitf5f7cb92646169a7096360506cef79a7a45571fa (patch)
treeed4d156f2b1504c68309c43fa7469d3dac97aa60 /doc
parent56f200af5d8a1d98b40d70ed54cf643afa0008dc (diff)
downloadnode-new-f5f7cb92646169a7096360506cef79a7a45571fa.tar.gz
Support for reading byte ranges from files using fs.createReadStream.
Diffstat (limited to 'doc')
-rw-r--r--doc/api.markdown8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/api.markdown b/doc/api.markdown
index 8c9b8dc25d..d50ba40af8 100644
--- a/doc/api.markdown
+++ b/doc/api.markdown
@@ -1583,6 +1583,14 @@ Returns a new ReadStream object (See `Readable Stream`).
, 'bufferSize': 4 * 1024
}
+`options` can include `start` and `end` values to read a range of bytes from
+the file instead of the entire file. Both `start` and `end` are inclusive and
+start at 0. When used, both the limits must be specified always.
+
+An example to read the last 10 bytes of a file which is 100 bytes long:
+
+ fs.createReadStream('sample.txt', {start: 90, end: 99});
+
## fs.WriteStream