Creating a folder and loops

  directory, windows

The question is related to speed over safety.
When my program will check if a folder exists in a loop everytime, it will decrease the speed. So:

Is it needed to do a check if a folder exist before creating it so it will not be created over and over, or Windows will not let to recreate the same folder repetitive and replace it?

Is it safe to leave it without checking the existence of the folder?

I meant not about programming language used, but more about software behavior in the case, if we have spam of generating folder with same name over and over, so more hypothetical.

Source: Windows Questions

LEAVE A COMMENT