问题
I was playing around with Apache VFS API to move files back and forth between my local machine and remote linux host over sftp and it converted some directories to files somehow on my linux host from drw-r-----
to -rw-r-----
Does anyone know how to convert it back to a directory?
回答1:
You have to remove the file and then make a directory containing the file's original name.
The problem is not that a directory was converted to a file, the problem was that a directory was deleted, and a file of the same name was created.
回答2:
Remove and create again:
rm foo
mkdir foo
Anyway if former directory is now file it is empty. In this case it is not a problem to re-create it.
回答3:
You can't convert a file to a directory. You can remove the file and create a directory with the same name.
Is there something strange with the changed directories?
来源:https://stackoverflow.com/questions/4855373/how-to-change-a-file-that-used-to-be-a-directory-back-to-directory-on-linux