I need to create a temp directory that will house another named directory and subfiles. In the end the named directory and subfiles will be appended to a tarball and the temp directory can be removed. Was initially going to use mkdtemp() but it looks like the TemporaryDirectory() method removes itself? Can someone explain the differences.
I need to create a temp directory that will house another named directory and
Share
You are correct in that the only real difference is that
TemporaryDirectorywill delete itself when it is done. It will let you do something like:when you leave the scope of the
with, the temporary directory will be deleted. Withmkdtemp, you would need to do that manually.