This project is read-only.

SCPClient Destination Folder

Jul 11, 2013 at 1:27 PM
Does anyone know how to use this API to copy files to a destination folder with blanks in the folder? It's telling me the directory doesn't exist. Works fine it the directory doesn't have blanks. In Linux, you can use a \ in front of the blank to change directory, but I have to use two \'s in string or VS gives me "unrecognized escape sequence".

Any help is appreciated.
Jul 11, 2013 at 3:22 PM
Edited Jul 11, 2013 at 3:44 PM
Put an '@' at the front of the string, e.g:
string bla = @"\\\\\\\\";
If you want to know why and what it means:
Jul 11, 2013 at 4:53 PM
Thanks for the answer, but I had also tried that with no luck.

I worked around this by creating an Upload directory, scp'ing it to that location, and then doing a MV of the file into the correct directory.
Jul 12, 2013 at 8:57 AM
Edited Jul 12, 2013 at 8:58 AM
  • in linux
mkdir "  Space Folder "
cd "  Space Folder "/
  • in c#
        string MKDIR = @"mkdir ""  Space Folder "" ";
        string MKDIR = "mkdir \"  Space Folder \" ";
        string CD= @"cd ""  Space Folder ""/ ";
        string CD="cd \"  Space Folder \"/";