diff options
author | Kyle Robinson Young <kyle@dontkry.com> | 2012-04-16 14:52:44 -0700 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-04-17 14:17:41 +0200 |
commit | 7cd1690f3dab62fea1c06ab26ade985cb1c85740 (patch) | |
tree | 264ec58cca6710fee11fd486d1d7eb6120b524f7 /doc | |
parent | 5bc07cc90b4fb0a18704bc7b60e120b22fc78df7 (diff) | |
download | android-node-v8-7cd1690f3dab62fea1c06ab26ade985cb1c85740.tar.gz android-node-v8-7cd1690f3dab62fea1c06ab26ade985cb1c85740.tar.bz2 android-node-v8-7cd1690f3dab62fea1c06ab26ade985cb1c85740.zip |
doc: add cache argument to fs.realpath()
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/fs.markdown | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown index c263380d67..96bef91eb5 100644 --- a/doc/api/fs.markdown +++ b/doc/api/fs.markdown @@ -194,12 +194,22 @@ linkString)`. Synchronous readlink(2). Returns the symbolic link's string value. -## fs.realpath(path, [callback]) +## fs.realpath(path, [cache], callback) -Asynchronous realpath(2). The callback gets two arguments `(err, -resolvedPath)`. May use `process.cwd` to resolve relative paths. +Asynchronous realpath(2). The `callback` gets two arguments `(err, +resolvedPath)`. May use `process.cwd` to resolve relative paths. `cache` is an +object literal of mapped paths that can be used to force a specific path +resolution or avoid additional `fs.stat` calls for known real paths. -## fs.realpathSync(path) +Example: + + var cache = {'/etc':'/private/etc'}; + fs.realpath('/etc/passwd', cache, function (err, resolvedPath) { + if (err) throw err; + console.log(resolvedPath); + }); + +## fs.realpathSync(path, [cache]) Synchronous realpath(2). Returns the resolved path. |