Continues a file search started as a result of a preceding call to WebFtpFindFirstFile.
WebAPI.bdh
WebFtpFindNextFile( in hFtp : number, out sFile : string, in nMaxFile : number, out nAttribute : number ): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
hFtp | Valid handle to an FTP session. This handle must have been returned from a previous call to WebFtpConnect. A successful call to WebFtpFindFirstFile has to be completed before WebFtpFindNextFile can be used. |
sFile | Parameter that receives the name of the file or directory |
nMaxFile | Maximum length of the string to put into sFile |
nAttribute |
Parameter that receives one or more of the following attribute flags:
|
// Connect to the FTP server and list the root directory // 1) using WebFtpFindFirstFile, WebFtpFindNextFile in loops // 2) using only the command WebFtpListDirectory dcltrans transaction TWebFtpListDir var hFtp : number; sFileName : string(MAX_PATH); nAttribute : number; nFiles : number; bOk : boolean; begin WebFtpConnect(hFtp, "standardhost", WEB_PORT_FTP, "", ""); nFiles := 0; // Custom directory list enumeration bOk := WebFtpFindFirstFile(hFtp, "", sFileName, MAX_PATH, nAttribute); while bOk do write(sFileName); write(" "); write(nAttribute); writeln; nFiles := nFiles + 1; bOk := WebFtpFindNextFile(hFtp, sFileName, MAX_PATH, nAttribute); end; if nAttribute = WEB_FTP_FA_NO_MORE_FILES then write(nFiles); write(" files found"); writeLn; else write("Error retrieving directory information!"); writeln; end; // The following command does the same WebFtpListDirectory(hFtp, ""); WebFtpShutdown(hFtp); end TWebFtpListDir;
Ftp.sep