Good day,
such a situation, you need to put the file on a certain path, but there is a possibility that certain directories (folders) simply do not exist, then it is logical that you need to create them. Question: how to check the existence of all path directories, if they do not exist, then create them yourself?
Example: put on the way
D: \ some \ new \ directory \
Some folder is empty, i.e. need to create directory
D: \ some \ new \
and then
D: \ some \ new \ directory \