如何将一个曾经是目录的文件改回linux上的目录?
我正在使用 Apache VFS API 通过 sftp 在本地计算机和远程 Linux 主机之间来回移动文件,它以某种方式将一些目录从 drw-r-----
drw-r----- 转换为我的 Linux 主机上的文件code> 到 -rw-r-----
有谁知道如何将其转换回目录?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您必须删除该文件,然后创建一个包含该文件的原始名称的目录。
问题不在于目录被转换为文件,问题在于目录被删除,并创建了同名文件。
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.
删除并再次创建:
无论如何,如果以前的目录现在是文件,那么它是空的。在这种情况下,重新创建它不是问题。
Remove and create again:
Anyway if former directory is now file it is empty. In this case it is not a problem to re-create it.
您无法将文件转换为目录。您可以删除该文件并创建一个同名的目录。
更改后的目录有什么奇怪的吗?
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?