On Wed, Feb 26, 2014 at 4:40 PM, Alex Kocharin <[email protected]> wrote: > > This sounds like a very good idea... I wonder, is there any downside to it? > Performance maybe?
Its good idea if its what you want to do. It doesn't work with directories on systems that don't allow hard links between directories (do any?). rename(2) exists partly so it can be atomic with directories, and also because if you want an atomic "replace" (which is what rename does in case that target exists), you can't do that without having race conditions (unlink(dst), ^RACE HERE while dst doesn't exist, link(src,dst), unlink(src)) so there is need for rename() to be a system call. Btw, there is great discussion of this on lwn.net recently, tl;dr is that lack of a flags, so that O_EXCL could be passed, is a Unix API anti-pattern :-) http://lwn.net/Articles/585415/ -- -- 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 --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
