nodejs API fs.fsync(fd, callback)

javascript, node.js

Solution

`fs.fsync` is just an asynchronous node wrapper for unix's `fsync`. Notice there's also an `fs.fsyncSync`, which is just the synchronous version. They just happen to be named in a confusingly standard manner.

http://unixhelp.ed.ac.uk/CGI/man-cgi?fsync+2

http://linux.die.net/man/2/fsync

Problem

What's ths use of `fs.fsync(fd, callback)` in nodejs API? `fs.fsync(fd, callback)` Asynchronous fsync(2). No arguments other than a possible exception are given to the completion callback. `fs.fsyncSync(fd)` Synchronous fsync(2). Node.js API docs for `fs.fsync`

Original source