Closed teobugslayer closed 8 years ago
@justinmchase,
reg.exe is subject to Windows File Protection since Windows 2000, and it would be extremely hard for the file to disappear.
Furthermore, on a multi-user, multiprocess OS, the "file exists" checks are pointless (even Node.js v5 deprecates FS.exists() API). That's because the file can cease to exist after the check was made but before the actual use.
@teobugslayer Regarding your comment that file exists checks are pointless, this is certainly untrue. The time between the file exists check and it being used is so short that the chance of it being deleted in that small time is incredibly tiny. Node 5 deprecates that API in favour of better ones, not because it is useless.
Ok let's not debate the merits of checking files before attempting to read them here :)
I was merely thinking, if reg.exe
wasn't at the default place then changing the behavior to use standard path rules might make sense. But based on @teobugslayer's comments it should be assumable that the file is always there and if its not then you probably have a big problem anyway. So in that case, I think its fine to assume the file location and not have backup behavior.
Works fine, thank you for your contribution.
When can we expect to release this in the npm?
I just published it.
Great news, thank you! I'll update to it as soon as possible.
See https://github.com/fresc81/node-winreg/issues/17