Control psftp (PuTTy) through matlab
이전 댓글 표시
My issue is I want to download data from url "http://" through psftp and I have all the command on terminal but I would like to do that through matlab code.
My code is this on terminal:
psftp
psftp> open host.name
psftp> cd path/to/path
psftp> mget ./*.O
so I want to write a code on MatLab to do the same thing.
note that the host.name is http:// website.
댓글 수: 6
Walter Roberson
2021년 5월 31일
Which operating system are you using? That will determine your options.
Are you using psftp instead of https://www.mathworks.com/help/matlab/ref/ftp.html because ftp() does not offer encryption?
Aliaa Abdelnasser Madbouly Afify
2021년 5월 31일
Walter Roberson
2021년 5월 31일
psftp is a Secure Shell ftp client -- an SFTP client. It cannot be used to communicate using ftp protocol to talk to an http protocol host.
Look at the documentation: https://documentation.help/PuTTY/psftp-cmd-open.html#S6.2.3 . The open command does not support supplying an http: url, only a hostname (or IP), or user@hostname .
If you are able to reach the host from the terminal using psftp then you are communicating with it using ftp or sftp protocol, not http protocol, and that implies that using MATLAB's ftp() might work.
Aliaa Abdelnasser Madbouly Afify
2021년 6월 2일
Walter Roberson
2021년 6월 2일
To check: did you put the actual hostname (or IP address) into the ftp command, in place of where you wrote 'hostname' ?
Also, the psftp sequence you showed does not set a username or password, so you are possibly using anonymous ftp, in which case you would not supply the username or password. Possibly just something like
X = ftp('speedtest.tele2.net')
Aliaa Abdelnasser Madbouly Afify
2021년 6월 2일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Call Web Services from MATLAB Using HTTP에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!