source: prextra/@ftp/delete.m @ 158

Last change on this file since 158 was 113, checked in by bduin, 8 years ago
File size: 621 bytes
Line 
1function delete(h,filename)
2%DELETE Delete a file on an FTP server.
3%    DELETE(FTP,FILENAME) deletes a file on the server.
4
5% Matthew J. Simoneau, 14-Nov-2001
6% Copyright 1984-2012 The MathWorks, Inc.
7
8% Make sure we're still connected.
9connect(h)
10
11if any(filename=='*')
12    listing = h.jobject.listNames(filename);
13    names = cell(size(listing));
14    for i = 1:length(listing)
15        names{i} = listing(i);
16    end
17else
18    names = {filename};
19end
20
21for i = 1:length(names)
22    status = h.jobject.deleteFile(names{i});
23    if (status == 0)
24        error(message('MATLAB:ftp:DeleteFailed',char(names{i})));
25    end
26end
Note: See TracBrowser for help on using the repository browser.