Update docs, fix test failure
This commit is contained in:
parent
6a5d9073f3
commit
7d196763f8
17
README.md
17
README.md
|
@ -914,7 +914,22 @@ fs.open('/myfile.txt', function(err, fd) {
|
|||
|
||||
#### fs.fsync(fd, callback)<a name="fsync"></a>
|
||||
|
||||
NOTE: Not yet implemented, see https://github.com/filerjs/filer/issues/87
|
||||
Synchronize the data and metadata for the file referred to by `fd` to disk.
|
||||
Asynchronous [fsync(2)](http://man7.org/linux/man-pages/man2/fsync.2.html).
|
||||
The callback gets `(error)`.
|
||||
|
||||
```js
|
||||
fs.open('/myfile', 'r', function(error, fd) {
|
||||
if(err) throw err;
|
||||
|
||||
// Use fd, then sync
|
||||
|
||||
fs.fsync(fd, function(error) {
|
||||
if(err) throw err;
|
||||
fs.close(fd, done);
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
#### fs.write(fd, buffer, offset, length, position, callback)<a name="write"></a>
|
||||
|
||||
|
|
|
@ -38,8 +38,8 @@ describe('fs.fsync', function() {
|
|||
if(error) throw error;
|
||||
|
||||
fs.fsync(fd, function(error) {
|
||||
expect(error).to.not.exist;
|
||||
fs.close(done);
|
||||
expect(error).not.to.exist;
|
||||
fs.close(fd, done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue