source: prextra/@ftp/cd.m @ 131

Last change on this file since 131 was 113, checked in by bduin, 8 years ago
File size: 653 bytes
Line 
1function 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.
10connect(h)
11
12if (nargin > 1)
13    isSuccess = h.jobject.changeWorkingDirectory(str);
14    if ~isSuccess
15        error(message('MATLAB:ftp:NoSuchDirectory', str))
16    end
17end
18newDir = char(h.jobject.printWorkingDirectory);
19% There isn't an easier way to set the value of a StringBuffer.
20h.remotePwd.setLength(0);
21h.remotePwd.append(newDir);
Note: See TracBrowser for help on using the repository browser.