Subject: Re: large file support in sftp

Re: large file support in sftp

From: <Martin.Dommermuth_at_inovasec.de>
Date: Tue, 1 Jun 2010 16:30:28 +0200

Hi again!

Daniel Stenberg wrote:

> But I figure it could also be a problem on the server-side. You need to
> provide more details for us to be able to tell for sure. You also didn't

> mention what version you're using.

You are right, I should give more details.

I use the following script to get the size of a remote file:

use Net::SSH2;
use Data::Dumper;

my $ssh2 = Net::SSH2->new();

$ssh2->connect('172.1.1.1', 222) or die $!;

if ($ssh2->auth_publickey('dummy', '/tmp/key.pub', '/tmp/key.priv' ))
{
      my $sftp = $ssh2->sftp();
      my $fileinfo = $sftp->stat('/tmp/file.big') or die;
      print Dumper($fileinfo);
}

I tried this script again with Ubuntu 10.04. versions:
Kernel 2.6.32-22-generic #33-Ubuntu SMP
libssh2 1.2.2.
OpenSSH_5.3p1 Debian-3ubuntu3
OpenSSL 0.9.8k
Perl Net:SSH2 0.28

My test before failed when the file size exceeded 2047MB. Now I hit a
limit at 4095MB.

4095MB:
# perl test.pl
$VAR1 = {
          'uid' => 0,
          'mtime' => 1275400507,
          'mode' => 33279,
          'name' => '/tmp/file.big',
          'atime' => 1275400080,
          'gid' => 0,
          'size' => 4293918720
        };

4096MB:
# perl test.pl
$VAR1 = {
          'uid' => 0,
          'mtime' => 1275400990,
          'mode' => 33279,
          'name' => '/tmp/file.big',
          'atime' => 1275400982,
          'gid' => 0,
          'size' => 0
        };

Thanks,

MartinD:

___________________________________
INOVASEC GmbH
Martin Dommermuth
___________________________________

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-06-01