This is half suggestion for improvement, half request for information.

Tring to walk a directory tree over FTP using Rev; obviously can get the
listing of a folder by getting a URL ending in "/".  The one needs to parse
the listing; the first character of each line will tell you if it's a
directory or not, the last part of the line is the filename.

But how reliable is the format?  Looking at one example, it seems as if one
could say that the filename would start at the 9th word on each line.  It
also looked as if one could say that the filename started at the 52nd
character on each line.  But looking at the RFC (959), in the section on
LIST it states 
    Since the information on a file may vary widely from system
    to system, this information may be hard to use automatically
    in a program, but may be quite useful to a human user.

It then goes on to document the solution to this problem, NLST:
    This command is intended to return information that can be
    used by a program to further process the files automatically.

So the suggestion for improvement would be for the FTP library to have some
mode that returns an NLST listing instead of a LIST listing.

However....  watching the actual traffic while I used a couple of different
FTP programs to browse servers showed that they both used LIST rather than
NLST to get their data.  That suggests that there is a reliable way to parse
the LIST output.

Is RFC959 just wrong?  Has there been some subsequent standard that defines
the format in which an FTP server will respond to a LIST request?  Is there
something which is defined to be reliable - or do we just infer (9th word,
52nd column) and hope for the best?

Any info gratefully received.

TIA,

  Ben Rubinstein               |  Email: [EMAIL PROTECTED]
  Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
  http://www.cogapp.com        |  Fax  : +44 (0)1273-728866


_______________________________________________
improve-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/improve-revolution

Reply via email to