in reply to sftp->do_write howto?
Since you said that you are trying to do this without creating a local file, the previous response doesn't really answer the question. Reading the source, the flags for open are the Constants prefixed with SSH2_FXF_. Specifically,
'SSH2_FXF_READ' => 0x01, 'SSH2_FXF_WRITE' => 0x02, 'SSH2_FXF_APPEND' => 0x04, 'SSH2_FXF_CREAT' => 0x08, 'SSH2_FXF_TRUNC' => 0x10, 'SSH2_FXF_EXCL' => 0x20,
Which should look familiar to anyone who has ever opened a file à la C. You say you want to append to an existing remote file, so you do not need READ, CREAT(e), TRUNC(ate) or EXCL(ude). You do need WRITE and APPEND, so your flags are:
SSH2_FXF_WRITE | SSH2_FXF_APPEND
(Remember that you OR flags when you want them both)
Update: As is pointed out by insaniac, this is not the only code change. You either neet to use the hex listed above (less portable) or follow the instructions in the docs:
use Net::SFTP::Constants qw( SSH2_FXP_WRITE SSH2_FXF_APPEND );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sftp->do_write howto?
by chrism01 (Friar) on Sep 22, 2005 at 01:38 UTC | |
by insaniac (Friar) on Sep 22, 2005 at 10:41 UTC | |
by chrism01 (Friar) on Sep 22, 2005 at 23:46 UTC | |
by insaniac (Friar) on Sep 23, 2005 at 08:28 UTC | |
by insaniac (Friar) on Sep 23, 2005 at 11:53 UTC | |
by chrism01 (Friar) on Sep 27, 2005 at 06:12 UTC | |
|