From 241950c1dfd42b85d50a175c76efa275864b8ce7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 11 Sep 2009 13:41:47 +0200 Subject: Add isDirectory(), isFile(), isSocket(), ... methods to stats object. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Felix Geisendörfer for the initial patch. --- doc/api.txt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'doc/api.txt') 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 -- cgit v1.2.1