Discuss this help topic in SecureBlackbox Forum

TElSimpleFTPSClient.ListDirectory

TElSimpleFTPSClient     See also     


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


Lists the remote directory contents.

Declaration

[C#/Java]
    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)

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 an array specified by 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 mask which can be a simple mask, set of masks or regular expression (read more about masks).

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

See also:     About file masks and regular expressions     GetFileList     GetNameList     MLSD     OnTextDataLine    

Discuss this help topic in SecureBlackbox Forum