Every time there's a complaint like this, we get one step closer to deprecating exists().
Use fs.stat. It is the correct way to ask the question you're asking. On Fri, Jun 1, 2012 at 12:09 PM, Massimo Melina <[email protected]> wrote: > yes Mark, that's what i was trying to do. > I know the common way of doing this is by fs.stat() > Nonetheless the correct value for exists("my-file/.") is false, because that > doesn't exist. > The dot is a real entry in the file system, but exists only within > directories. > If you ask the operating system if that path "my-file/." exists you will get > a "no". > We are getting a "yes" just because it's easier to program, aren't we? But > truth is not always easy :) > It appears like a bug to me, but i will not make big complaints. > > On Fri, Jun 1, 2012 at 9:00 PM, Mark Hahn <[email protected]> wrote: >> >> You want `existsSync` to tell you if a path is a directory or a file. But >> `existsSync` doesn't do that. You would need to make that a feature >> request. >> > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
