Line | |
---|
1 | function 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. |
---|
9 | connect(h) |
---|
10 | |
---|
11 | if 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 |
---|
17 | else |
---|
18 | names = {filename}; |
---|
19 | end |
---|
20 | |
---|
21 | for 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 |
---|
26 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.