Discuss this help topic in SecureBlackbox Forum

TElSimpleFTPSClient.ListDirectory

TElSimpleFTPSClient     See also     


Filter: C#  VB.NET  Pascal  C++  PHP  Java  


Lists the remote directory contents.

Declaration

[C#]
    void ListDirectory(string Path, ArrayList Listing, string Mask, bool CaseSensitive, bool IncludeFiles, bool IncludeDirectories);
    void ListDirectory(string Path, ArrayList Listing, string Mask, bool CaseSensitive, bool IncludeFiles, bool IncludeDirectories, bool Recursive);

[VB.NET]
    Sub ListDirectory(ByVal Path As String, ByVal Listing As ArrayList, ByVal Mask As String, ByVal CaseSensitive As Boolean, ByVal IncludeFiles As Boolean, ByVal IncludeDirectories As Boolean)
    Sub ListDirectory(ByVal Path As String, ByVal Listing As ArrayList, ByVal Mask As String, ByVal CaseSensitive As Boolean, ByVal IncludeFiles As Boolean, ByVal IncludeDirectories As Boolean, ByVal Recursive As Boolean)

[Pascal]
    procedure ListDirectory(const Path : string; Listing : TList; const Mask : string; CaseSensitive : boolean; IncludeFiles, IncludeDirectories: boolean);
    procedure ListDirectory(const Path : string; Listing : TList; const Mask : string; CaseSensitive : boolean; IncludeFiles, IncludeDirectories, Recursive: boolean);

[C++]
    void ListDirectory(const std::string &Path, TList &Listing, const std::string &Mask, bool CaseSensitive, bool IncludeFiles, bool IncludeDirectories);
    void ListDirectory(const std::string &Path, TList *Listing, const std::string &Mask, bool CaseSensitive, bool IncludeFiles, bool IncludeDirectories);
    void ListDirectory(const std::string &Path, TList &Listing, const std::string &Mask, bool CaseSensitive, bool IncludeFiles, bool IncludeDirectories, bool Recursive);
    void ListDirectory(const std::string &Path, TList *Listing, const std::string &Mask, bool CaseSensitive, bool IncludeFiles, bool IncludeDirectories, bool Recursive);

[PHP]
    void ListDirectory(string $Path, TList $Listing, string $Mask, bool $CaseSensitive, bool $IncludeFiles, bool $IncludeDirectories)
    void ListDirectory(string $Path, TList $Listing, string $Mask, bool $CaseSensitive, bool $IncludeFiles, bool $IncludeDirectories, bool $Recursive)

[Java]
    void listDirectory(String Path, ArrayList Listing, String Mask, boolean CaseSensitive, boolean IncludeFiles, boolean IncludeDirectories, boolean Recursive);
    void listDirectory(String Path, ArrayList Listing, String Mask, boolean CaseSensitive, boolean IncludeFiles, boolean IncludeDirectories);

Parameters

  • Path - path to the directory to read.
  • Listing - the list will be filled by instances of the TElFTPFileInfo class, which represent the entries in the remote directory.
  • Mask - specifies the mask (wildcards) to select the names. Only the file and directory names that match the mask will be returned.
    Note, that FTP(S) doesn't support name masks, so, regardless of the mask, the whole directory will be read and scanned for matches.
  • CaseSensitive - specifies whether the mask is case-sensitive.
  • IncludeFiles - specifies whether filenames and symbolic links should be returned.
  • IncludeDirectories - specifies whether directory names should be returned.
  • Recursive - set this parameter to True to perform a recursive search, i.e., including subdirectories.

Description

    Use this method to list remote directory contents. This is a high-level method which choses the best listing command (MLSD is used, when available), changes working directory if needed (current directory is restored after the listing is obtained) and performs filtration of results.

    The method fills in the array specified by the Listing parameter with a list of TElFTPFileInfo objects.
    ListDirectory should be called once per enumeration, it returns the complete directory contents.

    Files are chosen by the mask which can be a simple mask, a set of masks, or a regular expression (read more about masks).
    Since SecureBlackbox version 13, file masks in group operations support expressions.

     [Pascal][C++]  Note, TElFTPFileInfo objects returned by this function are not destroyed by TElSimpleFTPSClient and thus *must* be freed by the user application.

Discuss this help topic in SecureBlackbox Forum