I\'m writing an embedded ftp server, and I cannot get the listing format correctly. The server works completely, only programs like FileZilla cannot interpret the listing format
Since you did not specify the programming language, I thought I would give my 2cents to this....
permissions[tab]number?[tab]owner[tab]group[tab]filesize[tab]date[tab]filename ^^^^^^^ ^^^^ no of inodes Dates can vary, it can be year on its own or Month, Day
I have decided to include the C# regexp's below to show, this can be adapted to suit your needs,
private Regex ftpUnixListInfo = new Regex( @"(?" + @"(?[-|d|r|w|x]+)\s+" + @"(?\d+)\s*" + @"(?\w+)?\s+" + @"(?\w+)\s*" + @"(?\d+)\s+" + @"(?\w+)\s+" + @"(?\d{1,2})\s+" + @"(?:(?\d{2}\:\d{2})|(?\d{4}))\s+" + @"(?.+))", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled); // Regex for Microsoft FTP Server private Regex ftpMsListInfo = new Regex( @"(?" + @"(?\d+-\d+-\d+)\s+" + @"(?\d+\:\d+(AM|PM))\s*" + @"(?((?\)|(?\d+))\s*)" + @"(?\w+))", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);
Notice the fact, there is no tab, it is purely spaces...and be careful, some FTP clients can read the listing as either MSDOS or Unix...