I was wondering how editing a remote file without downloading it to the local computer actually works in detail. After using google and reading some posts I learned that this is possible using the FTP or SSH protocol.

I assume that it's up to a special client application to set up a TCP/IP socket connection to a server, but what is going on after this is done?

Who needs to implement the protocol and how does another application that opens a remote file gain the data that it needs?

3 Answers
3

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.

FTP is not very good for such operations as it lacks partial uploads (i.e. you can't change a block of data in the middle of the file).
–
Eugene Mayevski 'EldoS CorpApr 14 '13 at 12:56

Sorry, I think I wasn't specific enough. I do understand how to write an application that will edit a remote file. I was rather wondering how things like a network drive in windows work: An application like Word for example doesn't really know that these are remote files, so I am asking myself: How does the application which set up the connection to the server know what data to transfer and when?
–
user2035039Apr 14 '13 at 15:46