5.6.17 LIST

The LIST command gets a list of file names from the remote FTP server.

The list object argument requires one, two or five fields.

If a one-field list is being used, then the unprocessed lines are added to the list.

If a two-field list is being used, the first field receives the file type and second field receives the file name.

If a five-field list is being used, the first field receives the file type, the second field receives the date, the third field receive the time, the fourth field receives the size and fifth field receives the file name.

The type field can contain the following values:

Syntax:

Command

Keyword

Value

Developer notes

LIST

PATH

value

If is not present, the current directory is used. The path can contain operating system wild characters.

FORMAT

*AUTO

Default. Auto-detect LIST format.

*NAME

Uses NLST subcommand. 1 column.

*UNIX

List is in UNIX format. 9 columns.

*UNIX8

List is in UNIX format. 8 columns.

*UNIX9

List is in UNIX format. 9 columns.

*ISERIES

List is in IBM i format.

DATEFORMAT

*NONE

Default. No date formatting is applied to the date field. Dates are formatted to ISO8601 format.

*DMY

Except the date to be in day, month, year order.

*MDY

Except the date to be in month, day, year order.

*YMD

Except the date to be in year, month, day order.

*YDM

Except the date to be in year, day, month order.

DATALINK

*PASV

Default. Use passive mode.

*PORT

Use port mode.

 

Example

LIST PATH(/folder/*.csv) #WRKLST(LINE)

 

LIST PATH(/folder/*.csv) #WRKLST(TYPE,NAME)

 

LIST PATH(/folder/*.csv) #WRKLST(TYPE,DATE,TIME,SIZE,NAME)