raszi / node-tmp

Temporary file and directory creator for node.js
MIT License
736 stars 92 forks source link

Missing tests for preexisting files/directory #162

Closed silkentrance closed 5 years ago

silkentrance commented 6 years ago

If tmp cannot create a tmp file or directory, especially when using the name option, because a file or directory of that name already exists, it will fail on max tries reached.

  1. fail early and not wait for max tries to be reached
  2. add missing tests
silkentrance commented 5 years ago

On second thought:

tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES;

already prevents this. Closing.