learn to use a temporary directory as a StackDir