Test utility for RAII ownership of a folder.
The folder, if it exists at the time of initialization, is deleted. It's also deleted at the end of the test when this class is destroyed.
- Note
- This class is incompatible with symlinks.
-
There are some protections in place to avoid common mistakes that decay to deleting standard UNIX folders, or the root folder. You cannot take ownership of anything under /usr, /bin, /share, /dev, /etc, /proc, or /boot. This is just a list of the most risky folders, though there are others that may be dangerous. Make sure to validate any generated paths you create BEFORE passing them to this class even with these protections in place.