ftp_glob(3)

NAME
ftp_glob, ftp_globfree - find pathnames matching a pattern from an FTP server

SYNOPSIS
#include <libfget.h>

int ftp_glob(FTP *ftp, const char *pattern, int flags, int (*errfunc)(const char *, int), ftp_glob_t *pglob);

void ftp_globfree(ftp_glob_t *pglob);

VERSION
This man page documents version 1.2 of libfget.

DESCRIPTION
The ftp_glob() function searches for all the pathnames on the FTP server associated with ftp which match pattern according to the rules used by the shell.

The ftp_globfree() function frees the dynamically allocated storage from an earlier call to ftp_glob().

RETURN VALUE
The ftp_glob() function returns 0 on success. On error, it returns a negative value, as follows. On malloc() error, it returns FTPGLOB_NOSPACE. On other system errors, it returns FTPGLOB_ABORTED and sets errno. If there is no match for pattern and FTPGLOB_NOCHECK is not set in flags, it returns FTPGLOB_NOMATCH.

If errno is set to ECONNRESET, it indicates that the server shut down the connection. The caller is then responsible for calling ftp_quit() with the FTP_FASTCLOSE flag set.

SEE ALSO
ftp_connect(3), glob(3)