Merge branch 'v0.10'
[platform/upstream/nodejs.git] / doc / api / fs.markdown
index bcf5b24..3a3e4c9 100644 (file)
@@ -63,11 +63,26 @@ Relative path to filename can be used, remember however that this path will be
 relative to `process.cwd()`.
 
 Most fs functions let you omit the callback argument. If you do, a default
-callback is used that ignores errors, but prints a deprecation
-warning.
+callback is used that rethrows errors. To get a trace to the original call
+site, set the NODE_DEBUG environment variable:
 
-**IMPORTANT**: Omitting the callback is deprecated.  v0.12 will throw the
-errors as exceptions.
+    $ cat script.js
+    function bad() {
+      require('fs').readFile('/');
+    }
+    bad();
+
+    $ env NODE_DEBUG=fs node script.js
+    fs.js:66
+            throw err;
+                  ^
+    Error: EISDIR, read
+        at rethrow (fs.js:61:21)
+        at maybeCallback (fs.js:79:42)
+        at Object.fs.readFile (fs.js:153:18)
+        at bad (/path/to/script.js:2:17)
+        at Object.<anonymous> (/path/to/script.js:5:1)
+        <etc.>
 
 
 ## fs.rename(oldPath, newPath, callback)
@@ -659,7 +674,7 @@ the file instead of the entire file.  Both `start` and `end` are inclusive and
 start at 0. The `encoding` can be `'utf8'`, `'ascii'`, or `'base64'`.
 
 If `autoClose` is false, then the file descriptor won't be closed, even if
-there's an error.  It is your responsiblity to close it and make sure
+there's an error.  It is your responsibility to close it and make sure
 there's no file descriptor leak.  If `autoClose` is set to true (default
 behavior), on `error` or `end` the file descriptor will be closed
 automatically.