fixes #1: guarantee that generated file/directory name is unique