Effacer les filtres
Effacer les filtres

how to abort mget operation?

3 vues (au cours des 30 derniers jours)
James Buxton
James Buxton le 26 Fév 2014
I'm trying to develop an application that reads folders and files from several FTP sites. I have developed a simple GUI to initiate the starting and stopping of files/folders being downloaded. My problem is that I cannot seem to stop an mget operation once it has started. Is this even possible? Currently, I have the mget operation tied to a pushbutton callback. When the button is pressed, an FTP session is opened, and the mget operation is executed. this works as expected. However, I have another pushbutton on the GUI. The goal is that when this pushbutton is pressed the FTP dowloading will stop. So to execute this this, I have the close(ftpobj) tied to the callback function for this second pushbutton. Unfortunately, when I press this button nothing happens and the FTP downloading continues to execute. Any help on this would be grealy appreciated.

Réponses (1)

Walter Roberson
Walter Roberson le 26 Fév 2014
After you close() the object, try putting in a pause() for a brief period of time. But first have it disp() a message saying that you got there -- it is possible that the callback is not getting serviced until later.
If that does not work, you might need to start a timer that does the close(). This would have to do with the fact that timers can interrupt at every line of a .m but graphic callback events can only interrupt when a pause() or drawnow() is done or a figure() is raised.
It would not surprise me if the real work is being done in Java and so cannot be manipulated by MATLAB directly.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by