Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

load-thru

 [1/3] from: th72::dds::nl at: 9-Nov-2006 11:45


Hello, Can someone explain how load-thru/check works? What do I provide in the info block? I would like to check the date of a net-file and download the file if the cached file is older. The documentation is a bit cryptic :-) Thanks Tim

 [2/3] from: anton::wilddsl::net::au at: 10-Nov-2006 12:53


Hi Tim, Yes, it works kind of the other way round than maybe expected. It assumes you already know details of the new remote file. This could be because you downloaded an index of all the remote files first, with size/date/checksum information in it. Note that LOAD-THRU uses READ-THRU which uses EXISTS-THRU? to see whether the file is good or not. Let's see... looking at source EXISTS-THRU?: The supported INFO types are: Type Example/Description ------------------------- block [345 10-Nov-2006/12:22:30+11:00] ; size and/or date in any order Either the cached file you have matches the date and size or else EXISTS-THRU? returns false, which means READ-THRU will download and cache it, and LOAD-THRU will LOAD it. tuple 1.2.3 ; version number Either the cached file's header you have has the same or greater version number than the tuple (from the index) you supplied, or else EXISTS-THRU? returns false. binary #{F0885A6F3DBB7C024F4962B73B6E4711124F23BC} ; checksum/secure Same again, the checksum you supply must match the checksum of the cached file you have already. logic TRUE ; or FALSE A logic! just appears to be ignored. If the file is in the cache, EXISTS-THRU? returns true, else false. date 10-Nov-2006/12:37:31+11:00 Is placed inside a block and processed as block, above. Anyway, if the date! of the cached file you have plus 3 seconds is still less than the index date you supplied, then EXISTS-THRU? returns false. none none INFO is ignored. If the file exists in the cache then EXISTS-THRU? returns it, so LOAD-THRU won't download it again. Hope that helps. Anton.

 [3/3] from: th72::dds::nl at: 10-Nov-2006 9:28


Thanks Anton,
>Yes, it works kind of the other way round than maybe expected. >
Yes that's absolutly true! I will investigate, thanks for your remarks. Tim