1
Vote

Ftp string format and _filedatetime

description

I get from ftp server following format:
 
-rw-rw-r-- 1 510 400 507 Mar 22 04:19 f3603341.eh
 
Not one of the string formats in the library is not suitable. I wrote new _ParseFormat for this ftp:
 
(?<dir>[-d])(?<permission>([-r][-w][-xs]){3})\s+(?<first_numer>\d+)\s+(?<second_number>\d+)\s+(?<thrid_number>\d+)\s+(?<size>\d+)\s+(?<timestamp>\p{Lu}.{2}\s+\d{2}\s+\d{2}:\d{2})\s+(?<name>.+)
 
Great, but expression at line 134 (FtpFile.vb) _fileDateTime = Date.Parse(m.Groups("timestamp").Value) work not correctly
 
Workaround:
 
_fileDateTime = DateTime.ParseExact(m.Groups("timestamp").Value, "MMM dd HH:mm", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AllowWhiteSpaces)

comments