So I've been implementing the ftp protocol for fun, and I'm basically done, but one annoying thing...the LIST command gives back a directory listing that seems to be in different format depending on what platform the FTP server happens to be running on. That's fine if I'm just writing a command-line ftp clone, but if I'm writing a GUI, I want my FTP library to be able to do a LIST via some function, and return a list data structure, where each list entry is something like:
typedef struct {
string name;
int size;
int prot;
bool is_dir;
} FtpFileEntry;
So then the question comes up, how am I supposed to parse the results if I don't even know what format will come back? I know that there's a command to fetch an OS string...but I'm not sure that all unixes will even give the same format, or that all windows platforms will return the same format, etc.
Any ideas?