How do I display ftp activity in the command window (and filter for a string)
Show older comments
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
Walter Roberson
on 21 Apr 2011
If you ask for a file that doesn't exist with mget(), what does ans come out as?
Walter Roberson
on 21 Apr 2011
If you ask for multiple files and one of them doesn't exist, how does that show up?
Elaine
on 22 Apr 2011
Walter Roberson
on 22 Apr 2011
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
on 22 Apr 2011
Answers (0)
Categories
Find more on Instrument Control Toolbox 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!