Fórum Localizar Arquivo*.zip no ftp #269712
22/02/2005
0
Pessoal,
Tem como eu tentar localizar um arquivo no ftp, enviando apenas parte do nome do arquivo?
tipo Arquivo*.zip
Estou usando componente IdFtp da paleta indy
Tem como eu tentar localizar um arquivo no ftp, enviando apenas parte do nome do arquivo?
tipo Arquivo*.zip
Estou usando componente IdFtp da paleta indy
Rafaelunp
Curtir tópico
+ 0
Responder
Posts
22/02/2005
Massuda
Segundo a Ajuda do Indy9, você pode usar o método TIdFTP.List.
Uma coisa que teria que testar, porque não fica claro no texto, é se o seguinte códigoretorna uma lista que inclui arquivos .ZIP nos subdiretórios do servidor.
procedure List(ADest: TStrings; const ASpecifier: string = ´´; const ADetails: boolean = true);
[b:bbbe6c20a6]Parameters[/b:bbbe6c20a6]
[i:bbbe6c20a6]ADest: TStrings[/i:bbbe6c20a6]
List for files and directories in the current directory.
[i:bbbe6c20a6]const ASpecifier: string = ´´[/i:bbbe6c20a6]
File mask for the listing. Default value is ´´.
[i:bbbe6c20a6]const ADetails: boolean = true[/i:bbbe6c20a6]
Include file details. Default value is True.
[b:bbbe6c20a6]Description[/b:bbbe6c20a6]
List is a procedure used to request a list of files or directories in the current directory on the FTP server.
ADest is a TStringList argument used to store the raw text values returned from the FTP server directory listing.
ASpecifier is a String value that contains a mask indicating the files and/or directories to be included in the listing. ASpecifier can contain common wildcard characters like ´*´ and ´?´. Some useful masks include:[list:bbbe6c20a6][*:bbbe6c20a6]*.* - All files in the current directory.[*:bbbe6c20a6]* - All directory entries in the current directory.[*:bbbe6c20a6]*. - All files regardless of extension in the current directory.[*:bbbe6c20a6]A??.txt - All text files that have a 3-character name starting with ´A´.[/list:u:bbbe6c20a6]
ADetails is a Boolean value that indicates if the list should contain details about the files and directories that match the mask in ASpecifier. When ADetails is False, only the file or directory name is returned in the ADest string list using the FTP NLST command. When ADetails is True, List can return FTP server-dependent details including the file size, date modified, and file permissions for the Owner, Group, and User using the FTP LIST command.
List will initialize and Clear the DirectoryListing property, and parse the return values in ADest into collection items in the DirectoryListing container. When ADest is empty, parsing of the formatted DirectoyListing is omitted.
List stores the return values form the FTP server in the the ListResult property, and allows use for the List command for either stand-alone use or for preparation of the structured DirectoryListing.
List calls methods in DirectoryListing that detects common data formats returned by FTP servers. Applications can override the default detection and parsing behavior by assigning procedures to the OnCheckListFormat and OnParseCustomListFormat event handlers
Uma coisa que teria que testar, porque não fica claro no texto, é se o seguinte código
var Lista: TStringList; ... IdFtp1.List(Lista, ´*.zip´);
Responder
Gostei + 0
23/02/2005
Alexpaes
Rafael eu gostaria de falar contigo,
sobre o winrar, eu vi algumas dicas suas com relação a isso, se puder entrar em contato comigo, pelo msn ou email (asp@iscc.com.br)
sobre o winrar, eu vi algumas dicas suas com relação a isso, se puder entrar em contato comigo, pelo msn ou email (asp@iscc.com.br)
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)