mirror of
https://github.com/fuse-friends/fuse-native
synced 2024-10-27 18:34:01 +00:00
README: slice should account for len given (#45)
This commit is contained in:
parent
db48a52bf8
commit
5fa4376b5f
@ -77,7 +77,7 @@ fuse.mount('./mnt', {
|
|||||||
},
|
},
|
||||||
read: function (path, fd, buf, len, pos, cb) {
|
read: function (path, fd, buf, len, pos, cb) {
|
||||||
console.log('read(%s, %d, %d, %d)', path, fd, len, pos)
|
console.log('read(%s, %d, %d, %d)', path, fd, len, pos)
|
||||||
var str = 'hello world\n'.slice(pos)
|
var str = 'hello world\n'.slice(pos, pos + len)
|
||||||
if (!str) return cb(0)
|
if (!str) return cb(0)
|
||||||
buf.write(str)
|
buf.write(str)
|
||||||
return cb(str.length)
|
return cb(str.length)
|
||||||
|
Loading…
Reference in New Issue
Block a user