Trapping mget FTP errors
4 views (last 30 days)
Show older comments
Trying to pull data from an FTP site using mget. Occasionally this fails, but unless I put a breakpoint at the exact mget call, and then step through with the debugger [1], it fails silently: I only get an error when the calling script tries to reference the missing (local) target folder, which mget is supposed to create if it doesn't exist. I don't see the FTP error itself.
I first tried installing this add-on to see if it would help to use FTP "pasv" mode. But based on the comments in its contents, it seems to be much older than my version of MATLAB (I'm on 2020a). At the risk of sounding obtuse, has this add-on's functionality been integrated into MATLAB by now, or does it still add something useful? How might I check?
Also, I found this recent discussion and specifically IA's solution of using a try/catch block, since mget does not have output arguments to examine. Is this the recommended/preferred way to trap mget errors?
Thanks,
-AMM
[1] Perhaps I'm misunderstanding how the debugger works with OOP classes/methods/etc. — I haven't worked with Matlab's OOP functionality before. But the fact that my code silently runs right past those FTP errors without printing anything to the Command Window is unexpected.
1 Comment
Zhigang Xu
on 24 Jun 2021
I have a similar problem: mget often hangs up in ftpping data from a host site. It works well sometimes and sometimes does not. Have you solved your problem? Tips? --- Zhigang
Answers (0)
See Also
Categories
Find more on FTP File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!