Home |
Function ftpcli_dir |
Function ftpcli_dirftpcli_dir performs an FTP LIST or NLST command on the FTP server. int ftpcli_dir(struct ftpcli * cc, int list, char * path, void (* user_function)(char *, int)); ParametersccPointer to the session context established in ftpcli_connect. listIf set to 0, the request is LIST (long dir), otherwise it is NLST (short) formatted dir. pathPointer to path/pattern specification (eg: *.* or *.c etc.). user_functionCallback function called for each line of the directory with a pointer to the text line and length. return valuePossible return values for this function are:
ftpcli_dir is used to retrieve formatted directory listings (LIST) or file listings (NLST) from the server. A user provided function is called for each line retrieved from the server. The user's function is called with a pointer to a string containing the returned line and the length of the line. This function allocates two TCP sockets, one to listen for a connection from the server and a second socket which is returned by accept and used for data transfer.
|