dir(ftpobj)
dir(ftpobj,folder)
details = dir(ftpobj,folder)
dir(
lists
the files in current folder on the FTP server associated with ftpobj
)ftpobj
.
dir(
lists
the files in the specified folder.ftpobj
,folder
)
returns
the results in a structure array that contains the name, modification
date, and size of each file.details
= dir(ftpobj
,folder
)
|
FTP object created by |
|
Character vector enclosed in single quotation marks that specifies
the target folder. To specify the folder above the current one, use |
|
|
Connect to the National Geophysical Data Center (NGDC) FTP server and view the contents:
ngdc = ftp('ftp.ngdc.noaa.gov'); dir(ngdc)
This code returns:
DMSP Solid_Earth international wdc INDEX.txt ftp.html ionosonde README.txt geomag mgg STP hazards pub Snow_Ice index.html tmp
Continuing the previous example, save the folder contents to
the structure n
, close the connection, and view
details about the pub
subfolder:
n = dir(ngdc); close(ngdc); n(14)
This code returns:
ans = name: 'pub' bytes: 9 isdir: 1 date: '12-Dec-2014 21:22:00' datenum: 7.3595e+05
FTP service courtesy of the NGDC. See NGDC Privacy Policy, Disclaimer, and Copyright for NGDC terms of service.