[PATCH] New function node.fs.isdir

320 views
Skip to first unread message

Felix Geisendoerfer

unread,
Sep 10, 2009, 10:37:47 PM9/10/09
to nod...@googlegroups.com
Hey Ryan,

let me know if you think this is useful. The patch contains the new function, docs & unit test.

-- Felix Geisendörfer aka the_undefined
0001-New-function-node.fs.isdir.patch

ryan dahl

unread,
Sep 11, 2009, 7:49:29 AM9/11/09
to nod...@googlegroups.com
Thanks.
I ended up doing this in a different way in
241950c1dfd42b85d50a175c76efa275864b8ce7. Does this work for you?

node.fs.stat(filename).addCallback(function (stats) {
stats.isDirectory();
})

- or -

node.fs.stats(filename).wait().isDirectory()

also added some other methods.

Felix Geisendörfer

unread,
Sep 11, 2009, 8:47:51 AM9/11/09
to nodejs
Oh nice! This is much much better : ). I guess next time I'll try to
get a hold of you first to discuss what I'm trying to do so I can make
a good patch that doesn't make you do all the work! I'm also starting
to learn some C++ and had some initial success making small tweaks and
stuff - will let you know when I get something useful going with it.

Anyway, thanks a ton for this patch, this is very convenient. It's
also much more POSIX compatible than my hard coded little flag
was ; ).

-- Felix Geisendörfer aka the_undefined

Reply all
Reply to author
Forward
0 new messages