0

我想知道如何在不将其下载到本地计算机的情况下编辑远程文件实际上是如何工作的。在使用谷歌并阅读一些帖子后,我了解到这可以使用 FTP 或 SSH 协议。

我假设由一个特殊的客户端应用程序来建立一个到服务器的 TCP/IP 套接字连接,但是完成后会发生什么?

谁需要实现该协议,另一个打开远程文件的应用程序如何获得它需要的数据?

4

3 回答 3

3

通过 SSH 工作的 SFTP 协议(​​不要与 FTP/FTPS 混合使用)允许对远程文件进行按块访问。它几乎可以与任何 SSH 服务器(允许使用 sftp 子系统)一起使用。

例如,以这种方式运行SFTP Net Drive 应用程序,它将远程服务器的文件系统安装为 Windows 驱动器。

于 2013-04-14T10:19:29.137 回答
0

如果您想进一步调查,有关FTPSFTP的 Wikipedia 文章似乎相当不错,并提供了 RFC 的链接。

谁需要实现该协议,另一个打开远程文件的应用程序如何获得它需要的数据?

你没有说你的程序将用哪种语言编写,但肯定有适合大多数人使用的 ftp 和 sftp 库。

如果你的程序在 Linux / OS X / 其他 BSD 上运行,你甚至可以调用ftp/sftp程序。

于 2013-04-14T10:28:24.587 回答
0

The application would download the whole file locally, open it, make changes and upload the whole file again. A classic example is WinSCP where you can 'edit' a remote file. The application (WinSCP) knows which protocol to use (FTP/FTPS/SFTP etc) and knows the parameters to be used (e.g. remote directory to upload the file to, username, password, port etc). Even if a file is large the whole file must be downloaded in order to me modified.

There appears to be no way of doing partial file updates in FTP, SFTP. HTTP or SCP. Infact there is no well known open source protocol to do this. If there is an implementation out there it has to proprietary.

于 2013-04-16T19:45:57.997 回答