Dir Method (FTP)


10.2, PLBCMP GUI Only

 

The Dir method retrieves a list of files names from a directory or directory information about a file(s) that is located on the FTP server. This method uses the following format:

 

[label]

{object}.Dir

[GIVING {return}] using [*RemoteFile=]{remotefile}[:

 

 

[*Flags=]{flags}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A FTP that has been declared.

return

Optional. A Numeric Variable that returns the number of items in the directory file list found by this method.

remotefile

Required. A Character String Variable or string literal that specifies the remote '[path+]file' that is used in the operation.

flags

Optional. A Numeric Variable or decimal number that specifies a bit mask value that can control the behaviors of this method.

Flags Affected: OVER, ZERO

Note the following:

  1. The ZERO flag is set if the {return} value is zero which indicates that no directory file list items have been found.

  2. The OVER flag is set if the {return} Numeric variable is too small to receive the item count without being truncated.

  3. Debug log entries may be generated if the debug logging is enabled. See the FTP Debug Method description to enable debug logging.

  4. The {remotefile} name can include asterisk (*) and question mark (?) characters as wildcard character only if the FTP server being accessed supports wildcards.

  5. The {flags} value is bit-mask that control the operations of the method. The bit-mask values are described as follows:

  6.  

    Values

    Description

    0x0

    If the 'flags' value is not used, the behavior is the same as when there are no bits set. In this case, the method returns a list of file and directory names along with other information like permissions, modification date, etc.

    0x1

    When this bit is set, the method only returns a list of file and directory names as specified by the 'remotefile' parameter. In this case, only names are returned without any other information.

    0x2

     When this bit is set, the method returns a list of file and directory names using the FTP 'MLSD' command that provides a standardized format for directory listings.

     

  7. The file/directory data retrieved by the FTP 'Dir' method can be accessed using the FTP DirItem method.

 

 

See Also: FTP Control Methods, Method Syntax



PL/B Language Reference Delete Method (FTP) DirItem Method (FTP)