login about faq

If I’m not mistaken, the function to move a file in Chilkat’s sftp object is to use ‘RenameFileOrDir’. But when I try to move a file from ‘TestFolder’ to ‘TestFolder2’ I get the error below. The test text file is in that location. How can I move this file?

ChilkatLog:
RenameFile:
DllDate:Jul 8 2013
ChilkatVersion: 9.4.1.25
UnlockPrefix: {my unlock code}
Username: xxxx
Architecture: Little Endian; 32-bit
Language: .NET 2.0
VerboseLogging: 0
SshVersion: SSH-2.0-1.36_sshlib GlobalSCAPE
SftpVersion: 3
oldFilename: /ftpjustin/TestFolder/testText.txt
newFilename: /ftpjustin/TestFolder2/testText.txt
StatusResponseFromServer:
Request: FXP_RENAME
InformationRecievedFromServer:
StatusCode: 2
StatusMessage: File not found
--InformationRecievedFromServer
--StatusResponseFromServer
Failed.
--RenameFile
--Chilkat Log

asked Jul 26 '13 at 10:06

ftpjustin's gravatar image

ftpjustin
1223

edited Jul 27 '13 at 21:17

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Removing the first slash from the file name DOES NOT solve this problem.

(Jul 26 '13 at 10:09) ftpjustin

Maybe the server is interpreting all paths as relative to the user account's HOME directory. Try a path that is relative to the HOME directory instead.

Also, you can always find out the exact absolute path as the server understands what you are passing by testing with the Chilkat.SFtp.RealPath method. See http://www.example-code.com/csharp/sftp_realPath.asp

For example:

string absPath = sftp.RealPath("/ftpjustin/TestFolder/testText.txt","");

link

answered Jul 27 '13 at 21:21

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×200
×4
×4

Asked: Jul 26 '13 at 10:06

Seen: 1,320 times

Last updated: Jul 27 '13 at 21:21

powered by OSQA