'dir' Command Hanging When Running the 'ftp' Command in MATLAB

3 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2023 年 4 月 5 日
回答済み: MathWorks Support Team 2023 年 4 月 6 日
I am attempting to connect using the 'ftp' command to a remote Linux server, and MATLAB hangs when I run the 'dir' command on the FTP object. The 'ftp' and 'dir' commands work for a different computer, so it only hangs on that specific server.
How do I prevent MATLAB from hanging for this workflow?

採用された回答

MathWorks Support Team
MathWorks Support Team 2023 年 4 月 5 日
The correct way to eliminate the hang is to ensure the 'LocalDataConnectionMethod' field of the FTP object is set to 'active' in MATLAB like so:
ip_addr = 'XXX.XXX.XXX.XXX';  % example IP
password='XXXXXX'; % example password
username= 'example'; % example username
ftpobj = ftp(ip_addr,username,password);
ftpobj.LocalDataConnectionMethod = "active";
This is because the 'active' mode establishes a channel for commands and the FTP server establishes a channel for data. For more information about the 'ftp' object and its options, please see the following documentation page:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInstall Products についてさらに検索

タグ

タグが未入力です。

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by