title: What cause the error "Couldn't canonicalise: No such file or directory" in SFTP?
body: <p>I am trying to use SFTP to upload the entire directory to remote host but I got a error.(I know SCP does work, but I really want to figure out the problem of SFTP.) </p>
  
  <p>I used the command as below:
  <code>(echo "put -r LargeFile/"; echo quit)|sftp -vb - username@remotehost:TEST/</code> </p>
  
  <p>But I got the error "Couldn't canonicalise: No such file or directory""Unable to canonicalise path "/home/s1238262/TEST/LargeFile"</p>
  
  <p>I thought it was caused by access rights. So, I opened a SFTP connection to the remote host in interactive mode and tried to create a new directory "LargeFile" in TEST/. And I succeeded. Then, I used the same command as above to uploading the entire directory "LargeFile". I also succeeded. The subdirectories in LargeFile were create or copied automatically. </p>
  
  <p>So, I am confused. It seems only the LargeFile/ directory cannot be created in non-interactive mode. What's wrong with it or my command?</p>