There is a similar question in the .NET version, but I'm asking specifically about the Python os.walk
function. I am using the latest Python 3.
Suppose I have a directory, for which there are many files. I am performing an operation that takes awhile on each file, leaving ample time for the root
directory to be changed mid loop by another process. Here would be an example, for clarity's sake:
for root, dirs, files in os.walk(rootDirectory):
for file in files:
doAReallyLongBlockingCall(file)
Would os.walk
detect such changes? If I add files, will they be found by os.walk
?