For example I have some http static server. I'm working with .js files via sftp. Keeping them sync. I'm wondering if .js file is replaced instantly or if the stfp server will write into that file as a stream?
So for example:
- client started uploading file
- read stream opened
- server accept that request
- open write stream into file location
- chunks sending to the server
- chunks accepted and piping into write stream
- http static server is trying to access file which is not yet uploaded completely and pick partially uploaded file?
- the result = js errors on the web page
- sftp load the whole file into the memory
- then dump whole file from memory into the file
This is the best scenario for me.
Haven't time to check how it's working. Any explanation would be good.