[REBOL] Re: Reading empty directories via FTP error
From: carl:cybercraft at: 24-Dec-2003 22:47
On 13-Nov-03, Carl Read wrote:
> I've still not had time to play with parse-dir-list myself. Will get
> there though.
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...
...
system/words/close port/sub-port
net-utils/confirm port/locals/cmd-port transfer-check
if empty? file-list [
...
to...
...
if not empty? file-list [system/words/close port/sub-port]
net-utils/confirm port/locals/cmd-port transfer-check
if empty? file-list [
...
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...
if (first system/words/pick port/locals/cmd-port 1) <> #"5" [
while [line: system/words/pick port/sub-port 1
] [append file-list join line "^/"]
temp: 'nlist
system/words/close port/sub-port
net-utils/confirm/multiline port/locals/cmd-port transfer-check
]
to this...
either (first system/words/pick port/locals/cmd-port 1) <> #"5" [
while [line: system/words/pick port/sub-port 1
] [append file-list join line "^/"]
temp: 'nlist
system/words/close port/sub-port
net-utils/confirm/multiline port/locals/cmd-port transfer-check
][
system/words/close port/sub-port
]
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.
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
on. I've no idea what's really happening here, so whether that's
true or not I don't know.
Anyway, here's what works for me...
decompress #{
789C9D544D4FE33010BDF7570C5921E090BA20EDA542F007567BD9BD454132CE
949A3AB6654F97EDBFDFB1D384A401C1E243555B6FDE7BF3152F43C4B2D1A134
3AD21A367BABA0AAA15A001F690C54D6117819A3FE8390FF07F7F700098EB6F4
2EF00BFF88B87FCC37E6D021D218506732BD99F3CDB87AE5742C52B9276DA290
4AA1A7B2434FD432B8E3276CFD1A2E1259BE6FB4C16356ADDC21440ADA3E9DC1
CD6AB5CA80972D23A032DAE21AE2813DB4E2C585260AAFD56EAA03D7EC4C7A8F
B679258667A72DA478281E4431A49932643374B81F61AB8982322EE254A20B7F
4D5A39CB956C3B90714AA6B7B6E9EC5090366E30946A8B6AD70BCF4587623692
64C99416150D8F63EA34034A32DD492D94F3079E882146DB887DCF4F5D153F7F
FCFA5D0C50D4B4C50097DD40BC53E1538EEB2BB8BD836FC5F762E4FEFFDB3509
FD6CEFFA731C253BCC527F3EEAE1043C6BA568F786EF49F3B34DCDEEABAF79A8
47CBF14EA77D5EFF5494382A4D4ABF5B21179081F901AAF3A580F3E5528C7794
878E59D3CE7371DF1439061BE73CDC9C6C41C0D6F1578043EA99D948925090D4
660D06ED136DEFDF1658D48BC53F76FE885BC7040000
}
Does that work for you, Ashley? And Brett? And any others who've
been testing this?
--
Carl Read