Very often in the Windows 7 console if I run a python program twice very quickly that does
if os.path.isdir(d):
shutil.rmtree(d)
if not os.path.exists(d):
os.mkdir(d)
where d
is the name of a directory with many files, I get a "Permission denied" for the mkdir
command. But if I run once, then wait some seconds, then run again I do not get such error.
What is the problem here?