+ 1
Creating a folder will be no problem. But I'm afraid you won't be able to create a file, run it and delete the file which started it all, since it will be opened during runtime.
You can check out my code in Sololearn, which creates a new file, runs it and the run creates yet another file. It will work alright. But deleting an open file during runtime may fail:
https://code.sololearn.com/c5f76DBYhYSO/?ref=app