node/deps/npm/node_modules/graceful-fs
Forrest L Norvell e79ccee168 npm: upgrade to v2.1.18
PR-URL: https://github.com/iojs/io.js/pull/266
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-08 23:49:03 +01:00
..
test npm: Upgrade to v2.1.6 2014-11-05 10:35:43 -08:00
.npmignore npm 1.1.0-beta-2 2011-12-14 14:17:16 -08:00
LICENSE npm: Upgrade to 1.2.30 2013-06-12 10:59:44 -07:00
README.md npm: Upgrade to v1.4.21 2014-07-31 09:05:30 -07:00
fs.js npm: upgrade to v2.1.18 2015-01-08 23:49:03 +01:00
graceful-fs.js npm: Upgrade to v1.4.21 2014-07-31 09:05:30 -07:00
package.json npm: upgrade to v2.1.18 2015-01-08 23:49:03 +01:00
polyfills.js npm: Upgrade to v1.4.21 2014-07-31 09:05:30 -07:00

README.md

graceful-fs

graceful-fs functions as a drop-in replacement for the fs module, making various improvements.

The improvements are meant to normalize behavior across different platforms and environments, and to make filesystem access more resilient to errors.

Improvements over fs module

graceful-fs:

  • Queues up open and readdir calls, and retries them once something closes if there is an EMFILE error from too many file descriptors.
  • fixes lchmod for Node versions prior to 0.6.2.
  • implements fs.lutimes if possible. Otherwise it becomes a noop.
  • ignores EINVAL and EPERM errors in chown, fchown or lchown if the user isn't root.
  • makes lchmod and lchown become noops, if not available.
  • retries reading a file if read results in EAGAIN error.

On Windows, it retries renaming a file for up to one second if EACCESS or EPERM error occurs, likely because antivirus software has locked the directory.

USAGE

// use just like fs
var fs = require('graceful-fs')

// now go and do stuff with it...
fs.readFileSync('some-file-or-whatever')