ftplib_listing_parse

Parses a line from remote directory listing.

SYNOPSIS

#include <ftplib.h>
struct ftp_list_entry *ftplib_listing_parse(char *fline);

PARAMETERS

fline
a single line returned from previous remote directory listing command. E.g.,
(fline = "----------   1 owner	group         1803128 Jul 10 10:18 ls-lR.Z")

DESCRIPTION

ftplib_listing_parse() will decompose a line pointed to by fline and returns pointer to malloc()ed ftp_list_entry strutcure that contains parsed information about the file entry. ftp_list_entry structure contains TAILQ_ENTRY fle_link so that structure can be chained together in a single list (List header should be of type struct ftp_list_t).


struct ftp_list_entry {
	TAILQ_ENTRY(ftp_list_entry)
		fle_link;
	u_char	fle_etype;		/* Entry type */
#define ETYPE_FILE	1
#define ETYPE_DIR	2
#define ETYPE_SYMLINK	3
#define ETYPE_DEVICE	4
	char	fle_perm[10];		/* Premissions as rwxr-xr-- */
	char	fle_owner[64];		/* Owner if the entry */
	char	fle_grp[64];		/* Group name */
	size_t	fle_size;
	time_t	fle_mtime;		/* Not used */
	char	fle_smtime[16];		/* Modification time/date */
	char	fle_name[PATH_MAX];
};

RETURN VALUE

Returns pointer to ftp_list_entry structure if successful or NULL otherwise.

$Id: ftplib_listing_parse.html,v 1.1 2002/12/02 03:12:52 te Exp $