FTP-list of files

Jan Schenkel janschenkel at yahoo.com
Sat Jul 6 00:15:01 EDT 2002

Thanks for the heads-up, Ben.
My bad -- I had forgotten that one little incident at
my previous job where our program ran quite happily at
our testsite but wouldn't run in the real environment
(was a monstrosity written in VB ; the IIS-server was
returning lines separated with 2 crlf's if i'm not
If our friend is running this to get dta from a
Unix-styleserver, this should work on most of them.
the rest requires some tweaking.
So have a look at what the "get URL" returns.
Hopefully my earlier hints are of use to you..

Best regards,


--- Ben Rubinstein <benr at cogapp.com> wrote:
> on 5/7/02 1:10 pm, Jan Schenkel at
> janschenkel at yahoo.com wrote:
> >> But you'll have to parse the reply to extract
> only
> >> the file names.
> >> 
> > 
> > Which you can do easily by filtering the results,
> as
> > files start with a '-' and
> folders/directories/however
> > you like to call themstart with a 'd'.
> Beware: this will work on many FTP servers, but by
> no means all.  IIS offers
> two formats - there's a checkbox on the control
> panel of the server to
> determine which one FTP clients will see.
> Tragically there is NO standard, only a number of
> conventions.  Ludicrously,
> the FTP RFC (standard) defines that an FTP server
> should respond to the LIST
> command (which is what is being used here) with a
> listing in a 'human
> readable' format, and doesn't specify it.  There is
> another command (I think
> NLIST, but my memory may be faulty) - which you'll
> have to hack libURL to
> send - which is defined to be easy for machines to
> read - but this doesn't
> include such useful information as whether this file
> is a directory or not.
> AFAIK there is no simple correct solution; you just
> have to code a parser to
> respond to all the formats you encounter/care about,
> and do lots of checking
> to be that the format you think you are parsing is
> exactly right.
> When I last looked into this, I hoped at least to
> find a helpful web page
> somewhere that would say 'these X FTP servers
> account for approx Y% of the
> installed base and these are the format(s) that each
> might respond to LIST
> with'.  But I found no such thing.  I found quite a
> few code snippets in
> various different languages/environments that
> claimed to parse FTP listings,
> but actually only parsed one format; some that took
> account of a few.  It's
> a nightmare.
> Of course, you may only be interested in a single
> case, in which case ignore
> all of this and just look at what you're getting
> back from that server.  If
> you are trying to write a generally accurate parser
> - please share any
> research you come up with!
>   Ben Rubinstein               |  Email:
> benr_mc at cogapp.com
>   Cognitive Applications Ltd   |  Phone: +44
> (0)1273-821600
>   http://www.cogapp.com        |  Fax  : +44
> (0)1273-728866
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com

Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free

More information about the Use-livecode mailing list