more problems with ftp

Alex Tweedly alex at
Sun Sep 12 19:32:46 EDT 2004

Hi Rand
just a quick note to append to my earlier email ...

Some more info on  libURLDownloadToFile

1. The docs describe it as "download an FTP URL", but in fact it can be 
used to download either ftp:// or http:// forms of URL (possibly others - 
those are all I've tried).

(In fact, I had tested FTP slightly, but had been mostly using http .....)

2. When you use libURLDownloadToFile to download an http file, when the 
downloadComplete handler is called (and assuming a successful download), 
then the local file will have been created and closed.

3. When you do the same with an ftp format URL, the local file will have 
been created - but it will still be open. (Don't know if this is always the 
case, but it has been in all my testing in the last hour or so).

I have had to add the line

    if cacheName is in the openfiles then close file cacheName

to my downloadComplete handler so that ftp:// files are properly closed 
(otherwise they are not available for other operations such as rename until 
Rev closes).

I don't know if this is a bug, or if this difference between http:// and 
ftp:// forms is intentional.

I think I'll play safe and guess that it is a bug, unless someone tells me 
otherwise; so I'll BZ it tomorrow if I haven't heard in the meantime. It 
certainly doesn't seem desirable to have the file be left open, and it is 
surprising to have to explicitly close it.

-- Alex.

More information about the use-livecode mailing list