Skip Menu |

This queue is for tickets about the Net-SSH2 CPAN distribution.

Report information
The Basics
Id: 59626
Status: rejected
Priority: 0/
Queue: Net-SSH2

People
Owner: Nobody in particular
Requestors: DOUGW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.31
Fixed in: (no value)



Subject: Net::SSH2::SFTP O_APPEND broken
The first time I run the below program the file is created. The second time it is run, the text should be appended, but instead the file is overwritten/truncated. I don't know if this is an error in the perl module or the underlying libssh2 library. #!/usr/bin/perl use strict; use warnings; use Net::SSH2; use Fcntl qw(:DEFAULT); my $user = 'username'; my $ip = 'xxx.xxx.xxx.xxx'; my $pass = 'password'; print "Connect\n"; my $ssh2 = Net::SSH2->new(); $ssh2->connect($ip) or die "Err connecting: $!"; print "Auth\n"; unless ( $ssh2->auth_password($user, $pass) ) { die "Err SSH auth: ", $ssh2->error()->[2], "\n"; } print "Write file\n"; my $sftp = $ssh2->sftp(); my $file = $sftp->open('tmp.txt', O_CREAT|O_APPEND|O_WRONLY) or die "Err SFTP: " . $ssh2->error()->[2] . "\n"; $file->write("test\n"); $ssh2->disconnect();
Hi, On Thu Jul 22 17:30:55 2010, DOUGW wrote: Show quoted text
> The first time I run the below program the file is created. The second > time it is run, the text should be appended, but instead the file is > overwritten/truncated. I don't know if this is an error in the perl > module or the underlying libssh2 library.
The OpenSSH server does not support append mode. It just ignores the flag. - Salva
Subject: Re: [rt.cpan.org #59626] Net::SSH2::SFTP O_APPEND broken
Date: Tue, 21 Sep 2010 17:53:10 -0400
To: bug-Net-SSH2 [...] rt.cpan.org
From: Rafael Kitover <rkitover [...] io.com>
Hi Salva, do you by any chance want to take over this module? "Salvador Fandino Garcia via RT" <bug-Net-SSH2@rt.cpan.org> wrote: Show quoted text
> Queue: Net-SSH2 > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=59626 > > >Hi, > >On Thu Jul 22 17:30:55 2010, DOUGW wrote:
>> The first time I run the below program the file is created. The second >> time it is run, the text should be appended, but instead the file is >> overwritten/truncated. I don't know if this is an error in the perl >> module or the underlying libssh2 library.
> >The OpenSSH server does not support append mode. It just ignores the flag. > >- Salva
-- Sent from my Android phone with K-9 Mail. Please excuse my brevity.
This is a limitation of the server.