replace a directory with its file
