Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

dir (ftp) - Directory contents on FTP server

Syntax

dir(f,'dirname')
d = dir(...)

Description

dir(f,'dirname') lists the files in the specified directory, dirname, on the FTP server f, where f was created using ftp. If dirname is unspecified, dir lists the files in the current directory of f.

d = dir(...) returns the results in an m-by-1 structure with the following fields for each file:

FieldnameDescriptionData Type
name

Filename

char array

date

Modification date timestamp

char array

bytes

Number of bytes allocated to the file

double

isdir

1 if name is a directory; 0 if not

logical

datenum

Modification date as serial date number

char array

Examples

Connect to the MathWorks FTP server and view the contents.

tmw=ftp('ftp.mathworks.com');
dir(tmw)

This code returns the following:

README    incoming  matlab    outgoing  pub       pubs

Save the folder contents to the structure m and view element 5.

m=dir(tmw);
close(tmw);

m(5)

This code returns:

ans = 
       name: 'pub'
       date: '13-Aug-2008 00:00:00'
      bytes: 512
      isdir: 1
    datenum: 733633

See Also

ftp, mkdir (ftp), rmdir (ftp)

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS