remy/nodemon — pull request #231 by davedoesdev (2013-12-05 07:16:28+00:00)
Title: Use random bytes for check file rather than time to prevent rare unlink error

Very occasionally I get this error:

```
Error: ENOENT, no such file or directory '/tmp/nodemonCheckFsWatch1386226672479'
at Object.fs.unlinkSync (fs.js:760:18)
at Object.watchFileChecker.check (/home/david/.nvm/v0.10.22/lib/node_modules/nodemon/nodemon.js:167:6)
at ready (/home/david/.nvm/v0.10.22/lib/node_modules/nodemon/nodemon.js:49:22)
at /home/david/.nvm/v0.10.22/lib/node_modules/nodemon/nodemon.js:63:11
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket. (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
```

I'm running two nodemon's in the background, starting them one after the other.

I found the cause was that they got the same `Date.now()` value. I guess it depends on the resolution of the clock . I've only seen it a couple of times in hundreds of runs but after the first time I added logging of the filename and found it was the same. Using a random name should fix this.