且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从Linux EXTREME VPS读取文件时找不到文件异常

更新时间:2022-03-16 18:44:41

我认为问题在于您使用了错误的文件路径.

I think that the problem is that you are using the wrong file path.

您说您正在Linux服务器上读取文件,似乎您正在尝试在Windows计算机上读取文件.由此推断,您已将Linux文件服务器作为SMB文件共享安装在Windows机器上……或类似的 1 .

You say that you are reading a files on a Linux server, and it seems that you are trying to read them on a Windows machine. From this I infer that you have mounted the Linux file server on your Windows machine as an SMB file share ... or something like that1.

但是...您正在使用的路径看起来就像Linux文件路径:

However ... the path that you are using looks like a Linux file path:

  • 路径分隔符为/.
  • 路径以"/var/..."开头,这是UNIX/Linux系统的常见约定.

但是,如果您已远程安装Linux文件系统,则应使用的文件路径是您将在Windows命令提示符下使用的文件路径.可能以驱动器号开头.

But if you have remote mounted the Linux file system, the file path that you should use is the file path that you would use from the Windows command prompt. Probably starting with a drive letter.

(我不能告诉您它应该是什么.这取决于您挂载文件系统的方式以及远程文件服务器导出文件树的方式.)

(I can't tell you what it should be. It depends on how you mounted the file system, and how the remote file server exports the file tree.)

1-另一方面,您可能只使用一些在Internet上找到的代码,可能完全不适合您尝试执行的任务.