Archived Forum Post

Index of archived forum posts


SFTP WriteFileText access violation

Aug 13 '13 at 02:30

I try to use SFTP upload with embedded data, with WriteFileBytes. The byte data is extracted from a embedded ZIP.

This causes an access violation, so I tried WriteFileText, same result. The file is transferred completly.

It is always a read access violation, always the same address (depending on compiler): 0x00000028 at visual c++ 0x00000024 at borland c++

I have tried C++ and C API with Borland. For Visual C++ I only made a quick test with C:

HCkSFtp sftp; const char* handle;

sftp = CkSFtp_Create();

CkSFtp_UnlockComponent(sftp, "MY_PURCHASED_KEY");

if (CkSFtp_Connect(sftp, "", 22))
        if (!CkSFtp_AuthenticatePw(sftp, "root", "whatever"))

        if (!CkSFtp_InitializeSftp(sftp))

        handle = CkSFtp_openFile(sftp, "/root/test.txt", "writeOnly", "createTruncate");

        if (handle)
            CkSFtp_WriteFileText(sftp, handle, "ansi", "test\n"); // -> Trap!
            CkSFtp_CloseHandle(sftp, handle);
    while (0);



I have downloaded the latest version (9.4.1), Server is linux with openssh, client is windows 7 64-bit, application is always 32 bit.

Accepted Answer

Here's a new build for you to test:


Thanks! I found and fixed the problem. What new builds do you need? (VC++ versions?, Borland C++?, ec.)


I use RAD2010, the XE2 C++ build works pretty well for me. Thanks for your quick reply


Works, thank you.