login about faq

We are using the Sftp functions for now and that is working fine for now. But what I also need to do is append some text or a text file to a file already on our website. In looking at the VB6 examples, it looks like the write text file does that? I want to make sure it does not overwrite the text file already on the server, but appends the new text to it.

asked Apr 21 at 10:16

chilkat's gravatar image

chilkat ♦♦
11.8k316358421


The SFTP protocol specification is modeled somewhat like the typical local file IO functions a program might use. You open a file, write to it or read to it, and then close it. At the time of opening, you specify the behavior - which might be to open for append, where the file pointer is automatically at the end of the file and any data written is appended, or open for truncate, where the file, if it already exists, is opened and the file pointer is positioned at 0.

The SFTP protocol is the same, except that you're dealing with remote files over an SSH connection. The SFtp.OpenFile method has the createDisposition argument that controls how the file is opened (i.e. truncate, append, etc.) Of course, you'll want to test it first -- don't just trust that it'll behave as you expect. I'm confident Chilkat will send the desired create disposition options according to the SFTP protocol w/ the open request, but any given SFTP server implementation may not implement the full range of options available in the protocol. (I would hope the basic "append" disposition is supported by all servers..)

link

answered Apr 21 at 10:23

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×201
×1

Asked: Apr 21 at 10:16

Seen: 401 times

Last updated: Apr 21 at 10:23

powered by OSQA