Table of Contents

FTPLIST Function

Description

Retrieve a list of files from an FTP server.

Syntax

list = FTPLIST(ftpdomain,user,password,path,error)

Parameters

The function has the following parameters:

ParameterDescription
ftpdomainThe domain of the FTP site.
userA valid username of the FTP site.
passwordThe password of the user.
pathThe location of the files to be listed.
errorThe error status returned by the function.

Returns

A field mark (@fm) delimited list of files and file attributes.

Example

declare function ftpgetfile, msg, utility

 

ftpdomain = 'my.ftp.site.com'

user = 'someone'

password = 'a valid password'

path = 'myFtpFiles'

 

filelist = ftplist(ftpdomain,user,password,path,filename,error)

 

if filelist then

   swap char(13):char(10) with '' in filelist

   msg(@window,filelist)

end else

   if error then

      x = msg(@window, 'Contents of Error: ':error)

   end else

      x = msg(@window, 'No files returned')

   end

end