I have a FTP class which does pretty much everything. All has worked well so far, until last night when we discovered that a FTP server we were trying to connect to was returning the file list format in a different format.
Basically, a FTP server returns the directory listing like this:
total 4696
drw-rw-rw- 1 user group 0 Feb 6 15:46 .
drw-rw-rw- 1 user group 0 Feb 6 15:46 ..
-rw-rw-rw- 1 user group 4825 May 3 2010 Account.png
-rw-rw-rw- 1 user group 5242 May 3 2010 Administration.png
-rw-rw-rw- 1 user group 4117 Apr 17 2011 Agent.png
-rw-rw-rw- 1 user group 1402 Dec 30 2005 AmazonCA.gif
However, what I received was this:
-rwxrwxrwx 1 owner group 4480 Feb 15 2:25 8A17T2T1.txt
We can see there is an offset starting from the number of bytes.
I can check for a space character at a specific position to determine how to extract the number of bytes, the date and the name. Otherwise, I would apply a lookup based on the offset of that other format.
Anyone would have a comment on this?