%% List Details of Contents
% List details of the contents on an FTP server. The dir function can return a structure array that contains the name, modification date, and size of each item in the specified folder.
% First, connect to the National Centers for Environmental Information (NCEI) FTP server.

ftpobj = ftp('ftp.ngdc.noaa.gov')

%
% Return details about the items in the top-level folder on the FTP server. Some items are files and the others are folders.

listing = dir(ftpobj)

%
% Display details about the first item in the current folder, which is a folder named DSMP.

listing(1)

%
% FTP service courtesy of the National Centers for Environmental Information (NCEI). See the NCEI Privacy Policy, Disclaimer, and Copyright for NCEI terms of service.
% Copyright 2012 The MathWorks, Inc.