login about faq

I'm trying to create or truncate a file on the server (original code in FoxPro), but I'm getting the following response. I had changed the disposition to "createTruncate,deleteOnClose" when this started, and I removed deleteOnClose back out, but I am still receiving this message:

SftpVersion: 3
remotePath: (IP address cleared for security)/FTPTEST.TXT
access: readWrite
createDisposition: createTruncate
v3Flags: 0x1b
Request: FXP_OPEN
StatusCode: 2
StatusMessage: No such file
Actual code is as follows:
lcTargetFile = lcServerName + lcFoldername + "FTPTEST.TXT"
oSFTP.AuthenticatePW(lcServerUID, lcServerPwd)
lnHandle = oSFTP.OpenFile(lcTargetFile,"readWrite","createTruncate")
My handle at this point is an empty string, and the LastErrorText returns the above. Any hints or help would be greatly appreciated!

asked Jun 23 '16 at 09:09

BrianFarris's gravatar image


The remote file path argument to OpenFile should be a relative path from the HOME directory of the SSH/SFTP user account. You probably don't want the server name in the path, and you probably don't want the path to begin with "/" (which would specify an absolute path on the remote server).


answered Jun 23 '16 at 09:18

chilkat's gravatar image

chilkat ♦♦

I get the same response if I just use oSFTP.OpenFile("FTPTEST.TXT","readWrite","createTruncate"), except the remote path line is simply FTPTEST.TXT.

(Jun 23 '16 at 09:25) BrianFarris

When a customer under support provides me with a login for such a problem, the first thing I do is to get my bearings -- immediately after authenticating, I run a snippet of code that fetches the HOME directory listing and shows the entries (files/sub-directories) that are present. If they don't match what I would expect to see, then...


answered Jun 23 '16 at 09:32

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Jun 23 '16 at 09:09

Seen: 2,300 times

Last updated: Jun 23 '16 at 09:32

powered by OSQA