I'm trying to write a script to help me upload daily generated content to my server.
We're talking sometimes thousands of individual files each day, arranged like this:
Mostly the folders already exist, however each time the files are generated there is the possibility for additional folders also to be generated. So I need my script to create the folder for each file if it does not already exist.
I made the foolish assumption that
put "C:\files\1\1\2\4\1\2\1\abc.txt" "example.com/docs/1/1/2/4/1/2/1/abc.txt"
would create any directory that didn't already exist and then upload the file to it. I don't see why this is not possible?
To recursively scan each directory to discover if a particular location already exists coupled with the requisite string manipulation to create said folders is starting to sound like an awful lot of work for what should surely be a simple, automatic operation.
Many thanks in advance,