Archived Forum Post

Index of archived forum posts

Question:

SFTP RemoveFile: "File not found" or "No such file" error?

Dec 17 '12 at 13:04

I get this "No such file" error when trying to delete a file on an SFTP server? What could be the problem?

ChilkatLog:
  RemoveFile:
    DllDate: Dec 12 2012
    UnlockPrefix: UNTTSTSSH
    Username: CK2007:Chilkat
    Architecture: Little Endian; 32-bit
    Language: Visual C++ 6.0
    VerboseLogging: 0
    SshVersion: SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu3
    SftpVersion: 3
    filename: ./blah.txt
    StatusResponseFromServer:
      Request: FXP_REMOVE
      InformationReceivedFromServer:
        StatusCode: 2
        StatusMessage: No such file
      --InformationReceivedFromServer
    --StatusResponseFromServer
    Failed.
  --RemoveFile
--ChilkatLog


Answer

The path to the file your app is attempting to delete is shown in the LastErrorText. In this case, it is "./blah.txt". If the path is not an absolute path, as in this case, then it is a path relative to the HOME directory of the SSH/SFTP user account.

The SSH server's error message is accurate -- the file was not found (i.e. does not exist). Don't disbelieve it. One common error is that the SSH/SFTP user account's HOME directory is not what you expect. Verify what it is.