sftp.File read error, cannot read file large than 16777216 (2^24)
first, create a file larger than 2^24 byte
dd if=/dev/zero of=/tmp/zero.img bs=1M count=32
the golang code below demonstrates the bug:
// c is a sftp.Client
rName := "/tmp/zero.img"
fi, err := c.Lstat(rName)
if err != nil {
log.Fatal(err)
}
fp, err := c.Open(rName)
if err != nil {
log.Fatal(err)
}
defer fp.Close()
n, err := io.Copy(ioutil.Discard, fp)
if err != nil {
log.Fatal(err)
}
if n != fi.Size() {
log.Fatalf("copy %d != %d remote size", n, fi.Size())
}
This means I cannot use the sftp package as a sftp client to get large files from the server.
I think this might be the marshalUint64() bug. Does https://github.com/nemith/sftp/commit/6a6ba08f9e8eaaa485a98e836a9a34abbe39a102 fix your problem?
Yes, that fixex my problem. Thank you.
Thanks for looking into this, I'm sorry I've been absent on this package. I have some time set aside this weekend.
On 23/05/2014, at 23:47, hochhaus [email protected] wrote:
I think this might be the marshalUint64() bug. Does nemith@6a6ba08 fix your problem?
— Reply to this email directly or view it on GitHub.
Closed by #7 via #4