create a tempsubdir only when needed