Create a random file if path is a directory