3 graceful-fs functions as a drop-in replacement for the fs module,
4 making various improvements.
6 The improvements are meant to normalize behavior across different
7 platforms and environments, and to make filesystem access more
10 ## Improvements over [fs module](http://api.nodejs.org/fs.html)
14 * Queues up `open` and `readdir` calls, and retries them once
15 something closes if there is an EMFILE error from too many file
17 * fixes `lchmod` for Node versions prior to 0.6.2.
18 * implements `fs.lutimes` if possible. Otherwise it becomes a noop.
19 * ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or
20 `lchown` if the user isn't root.
21 * makes `lchmod` and `lchown` become noops, if not available.
22 * retries reading a file if `read` results in EAGAIN error.
24 On Windows, it retries renaming a file for up to one second if `EACCESS`
25 or `EPERM` error occurs, likely because antivirus software has locked
32 var fs = require('graceful-fs')
34 // now go and do stuff with it...
35 fs.readFileSync('some-file-or-whatever')