[REBOL] Re: Reading empty directories via FTP error
From: brett:codeconscious at: 13-Nov-2003 16:40
Hi Carl,
> Okay - have now. I found the difference between the empty directories
> on the two sites was that Nebularis was returning something so
> file-list wasn't an empty string, unlike the other site. Changing
> the original parse-dir-list from...
So, the Nebularis admin has changed his FTP server such that you get back a
string, which when parsed by REBOL will give you an empty file list, and
therefore sidesteps the NLST code.
Your other server is not returning anything so, in this the original REBOL
code would attempt to get a directory listing a second time by issuing a
NLST command and waiting for the response.
> was enough to get it working on both sites. However, that's just my
> sites and in cases where the second if wasn't acted on
> "system/words/close port/sub-port" would never happen, so I changed
> the second if to an either to ensure
> it did. ie, from this...
I'm glad you got something working, however, I think your code might be
working for the wrong reasons but I'm not sure of that.
> I tried having "system/words/close port/sub-port" only at the end of
> and outside the two if blocks but this didn't work. I see this is
> how your code worked Brett, so I assume that was the problem with it.
Yes - the first attempt
> It's very hard to see why it shouldn't work that way, other than the
> port needs to be closed before net-utils/confirm/multiline is acted
Yes, I think that is right. When the sub-port (the data connection) is
closed, the server may send an informative message via the command port
about how much was transferred - which in turn is handled by the
transfer-check.
I am becoming more sure that the code for NLST in the PARSE-DIR-LIST
function is a temporary and very unsightly, putting it mildy, hack job to
fix some obscure error in the past and which has finally fallen over. It
doesn't even support network tracing like the rest of the code. Sheesh. In
any case, the code is hard to follow when trying to mentally prove it.
It needs more attention.
Regards,
Brett.