Rev | Line | |
---|
[113] | 1 | function newDir = cd(h,str) |
---|
| 2 | %CD Change current working directory. |
---|
| 3 | % CD(FTP,'DIRECTORY') sets the current directory to the one specified. |
---|
| 4 | % CD(FTP,'..') moves to the directory above the current one. |
---|
| 5 | |
---|
| 6 | % Matthew J. Simoneau, 14-Nov-2001 |
---|
| 7 | % Copyright 1984-2004 The MathWorks, Inc. |
---|
| 8 | |
---|
| 9 | % Make sure we're still connected. |
---|
| 10 | connect(h) |
---|
| 11 | |
---|
| 12 | if (nargin > 1) |
---|
| 13 | isSuccess = h.jobject.changeWorkingDirectory(str); |
---|
| 14 | if ~isSuccess |
---|
| 15 | error(message('MATLAB:ftp:NoSuchDirectory', str)) |
---|
| 16 | end |
---|
| 17 | end |
---|
| 18 | newDir = char(h.jobject.printWorkingDirectory); |
---|
| 19 | % There isn't an easier way to set the value of a StringBuffer. |
---|
| 20 | h.remotePwd.setLength(0); |
---|
| 21 | h.remotePwd.append(newDir); |
---|
Note: See
TracBrowser
for help on using the repository browser.