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 件のコメント

Walter Roberson
Walter Roberson 2011 年 4 月 21 日
If you ask for a file that doesn't exist with mget(), what does ans come out as?
Walter Roberson
Walter Roberson 2011 年 4 月 21 日
If you ask for multiple files and one of them doesn't exist, how does that show up?
Elaine
Elaine 2011 年 4 月 22 日
testing - I responded to Walter Robertson's comments, but they do not show up?
Walter Roberson
Walter Roberson 2011 年 4 月 22 日
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.
Elaine
Elaine 2011 年 4 月 22 日
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).

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInstrument Control Toolbox についてさらに検索

質問済み:

2011 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by