diff options
author | Ryan <ry@tinyclouds.org> | 2009-09-11 13:41:47 +0200 |
---|---|---|
committer | Ryan <ry@tinyclouds.org> | 2009-09-11 13:41:47 +0200 |
commit | 241950c1dfd42b85d50a175c76efa275864b8ce7 (patch) | |
tree | 10f3d39ea3b4921c84c547da04535e5356fb447c /doc/api.txt | |
parent | 3e4fc9f9667331c6039bb880e6f1a275c9a34ccb (diff) | |
download | node-new-241950c1dfd42b85d50a175c76efa275864b8ce7.tar.gz |
Add isDirectory(), isFile(), isSocket(), ... methods to stats object.
Thanks to Felix Geisendörfer for the initial patch.
Diffstat (limited to 'doc/api.txt')
-rw-r--r-- | doc/api.txt | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/doc/api.txt b/doc/api.txt index df6b8fa5cf..b48344c52a 100644 --- a/doc/api.txt +++ b/doc/api.txt @@ -437,11 +437,12 @@ node.fs.stat("/tmp/world").addCallback(function (stats) { +node.fs.stat(path)+ :: See stat(2). - - on success: Returns +stats+ object. It looks like this: + - on success: Returns +node.fs.Stats+ object. It looks like this: +{ dev: 2049, ino: 305352, mode: 16877, nlink: 12, uid: 1000, gid: 1000, rdev: 0, size: 4096, blksize: 4096, blocks: 8, atime: "2009-06-29T11:11:55Z", mtime: "2009-06-29T11:11:40Z", ctime: "2009-06-29T11:11:40Z" }+ + See the +node.fs.Stats+ section below for more information. - on error: no parameters. +node.fs.unlink(path)+ :: @@ -518,6 +519,23 @@ node.fs.cat("/etc/passwd", "utf8").addCallback(function (content) { - on success: returns +data+, what was read from the file. - on error: no parameters. +==== +node.fs.Stats+ + +Objects returned from +node.fs.stat()+ are of this type. + ++stats.isFile()+:: + ++stats.isDirectory()+:: + ++stats.isBlockDevice()+:: + ++stats.isCharacterDevice()+:: + ++stats.isSymbolicLink()+:: + ++stats.isFIFO()+:: + ++stats.isSocket()+:: === HTTP |