How do I display ftp activity in the command window (and filter for a string)

I am connecting to a tape drive using the ftp command in the instrument control toolbox. After running tests on the tape drive, I ftp a file from the drive. When I ftp to the drive from a DOS window and issue the get command, some messages are displayed.
ftp> get myfile.dmp
200 PORT command successful.
226 Data transfer complete.
1589020 bytes received in 0.5seconds 3002.10 kBytes/sec ftp>
In Matlab, I issue the command: mget(aft, 'myfile.dmp'); (aft is my ftp object) and the file transfers ok, but I do not see any messages in the command window. If I leave off the ';' at the end, I get 'ans = [1x80 char]' in the command window. ans is the full path name of the file received.
I want to incorporate this into a function and need to detect that the transfer has completed before trying to access the data in the file, and before issue a command for the tape drive to proceed to the next step.

5 Comments

If you ask for a file that doesn't exist with mget(), what does ans come out as?
If you ask for multiple files and one of them doesn't exist, how does that show up?
testing - I responded to Walter Robertson's comments, but they do not show up?
That showed up.
Did you happen to quote a line by using " at the beginning and end of it? If so then you hit a bug in the system that causes everything else to be discarded. Same thing happens if you have a line that has ' at the beginning and end of it.
If I ask for a file that does not exist I get an ftp error 51. I don't think it is possible to ask for multiple files (unless you specify a directory name to get all files in the directory).

Sign in to comment.

Answers (0)

Categories

Find more on Instrument Control Toolbox in Help Center and File Exchange

Asked:

on 21 Apr 2011

Community Treasure Hunt

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

Start Hunting!