레이블이 ssh인 게시물을 표시합니다. 모든 게시물 표시
레이블이 ssh인 게시물을 표시합니다. 모든 게시물 표시

2011-07-08

erlang에서 sftp 실행하기

application:start(crypto).
application:start(ssh).
{ok, ConnectionRef} = ssh:connect(Host,Port,
              [{silently_accept_hosts, true}, {timeout, Timeout},{user,User},{password,Password}]).
{ok,ChannelPid}=ssh_sftp:start_channel(ConnectionRef).

Data=ssh_sftp:read_file(ChannelPid, File).