Indeed my last suggestion can only be used if you have the whole directory listing at once and not decoding it line by line.
But I tested it with SmartFTP and it does correctly decode it. This is because the listing has been detected as a unix format with a fixed column width.
The majority of unix listing, say like 95% do have exactly 1 space between the date and the filename. And now you only need to detect the irregular ones and handle them different. You can detect them according their characteristics like size, date, time representations.
I hope this helps you fixing the problem with the leading spaces.
-Mat
|