java - SFTP path format versus local path format -
i'm writing java code (using jsch library) sftp remote windows machine , copy file local windows folder.
when specifying path file on remote machine, i'm forced specify path in format /c/temp/myfile.txt
instead of c:\temp\myfile.txt
.
questions:
could tell me format is? there name it?
could tell me if it's possible use other format path? i'd able specify path
c:\temp\myfile.txt
, it's not apparent users whether file being sftp'd remote machine @ all. i'm guessing i'd have parse/split/replace characters in path ftp command wouldn't understand path format.
thanks.
sftp protocol mandates /
must used path separator.
see sftp specification:
this protocol represents file names strings. file names assumed use slash ('/') character directory separator.
file names starting slash "absolute", , relative root of file system. names starting other character relative user's default directory (home directory). note identifying user assumed take place outside of protocol.
it's sftp server maps real os-specific paths on server's file system syntax, conforms sftp specification.
you have use syntax, server's authors have chosen use.
so in cases have map \
/
.
and may need remove :
. though can configurable. many (particularly windows) sftp servers have configuration, allows map virtual sftp path real path. in case, may able map /c:/
c:\
.
in case, question not jsch, let java, sftp server.
see faq my winscp sftp client: how change drive on remote panel?
Comments
Post a Comment