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

[REBOL] Re: Desktop features

From: max::ordigraphe::com at: 19-Jul-2001 9:18

Taken from the reb site documentation... BUT I haven't checked if it works for the top-level "site" icon... -Max ------------------------------------ 11. Auto Updating Icon Files When the user clicks an icon, the file associated with it will be downloaded from the network, and it will be stored in a local cache. The next time the icon is clicked, the file will be retrieved from the cache, rather than being downloaded from the network again. What happens if the file is updated on the server? It will not be downloaded again, and the user will be using the old file. There are two solutions to this problem: Give the new file a different name. Provide a file stats block as part of your index file. The first solution is obvious. The file will be downloaded because it's name has been changed and there is no local cached copy of the file. The second solution is more powerful. It compares the cached file's datestamp and file size with those known by the server. This information can be provided within the icon specification in the index file. The file will only be downloaded if it needs to be. To enable this auto updating of files, the index file must include additional information for every icon that you want updated. Each icon must include a block that specifies its file size and date. The date must be in standard REBOL date/time/zone format. Here is an example: icon "name" %file.r [2345 10-Apr-2000/10:20-7:00] A simple way to create this block is to use REBOL. Here is an example script that does so. Cut and paste the result into your index file. REBOL [Title: "Create Icon Date/Size Stats"] file: %desktop.txt probe reduce [size? file modified? file] halt