creates nested directories for files