os.makedirs(path)
creates recursively all non existing directories
Is there a way to print all the newly created directories. Say if:
path = '/tmp/path/to/desired/directory/a/b/c'
and /tmp/path/to/desired/directory
already exists then it should return:
/tmp/path/to/desired/directory/a
/tmp/path/to/desired/directory/a/b
/tmp/path/to/desired/directory/a/b/c
Input is /tmp/path/to/desired/directory/a/b/c
so I am not sure till what level directories are existing, so I cannot use walk. Here in this example /tmp/path/to/desired/
may be already existing or not.
I am not looking for os.walk or list subdirectories. I am looking for only new directories created intermediately while os.makedirs()
. The input path is NOT a static one. It can be varied so I cannot go and check list of sub directories in it or the timestamp. I need to traverse entire filesystem then