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

read-thru check refinement

 [1/5] from: carl:cybercraft at: 22-Jul-2001 15:11


'read-thru has a 'check refinement for updating a file only if its date or size has changed. This requires an extra value of either a block, logic or none. What should the block contain? As trying read-thru/check using true, false or none makes no difference - the file is never updated regardless. -- Carl Read [carl--cybercraft--co--nz]

 [2/5] from: larry:ecotope at: 21-Jul-2001 20:51


Hi Carl The block is the standard info block for a file item in an index file: [971 23-Sep-2000/16:51:34-7:00] It contains the size in bytes and the time-stamp. Read-thru/check will not download a file if it is already in the cache and the date and time-stamp match those on the remote file. Cheers -Larry

 [3/5] from: carl:cybercraft at: 22-Jul-2001 17:42


Thanks Larry. Yes, that works, though I was sure I'd tried it. Still, it doesn't explain why we have to supply the date and time since they must be with the already downloaded file, right? And what's the point of supplying a logic or none? All very confusing... (: On 22-Jul-01, Larry Palmiter wrote:
> Hi Carl > The block is the standard info block for a file item in an index
<<quoted lines omitted: 19>>
>> Carl Read >> [carl--cybercraft--co--nz]
-- Carl Read [carl--cybercraft--co--nz]

 [4/5] from: arolls:bigpond:au at: 22-Jul-2001 19:51


Refer to the source to exists-thru?, which is used by read-thru.
> Still, it doesn't explain why we have to supply the date and time > since they must be with the already downloaded file, right?
Not necessarily. You could be supplying a minimum date for many files, for instance.
> what's the point of supplying a logic or none?
Well, if the 'info argument supplied to exists-thru? is a logic! (not a block!), then true is always returned. This means that read-thru tries to update the file from the net. So I don't really see the point either. There could be a function out there that sometimes supplies exists-thru? with a logic! Which gives me an idea.
> > The block is the standard info block for a file item in an index > > file: > > > [971 23-Sep-2000/16:51:34-7:00] > > > It contains the size in bytes and the time-stamp. Read-thru/check > > will not download a file if it is already in the cache and the date > > and time-stamp match those on the remote file.
Actually, exists-thru? returns true if the net-file is newer than the cache-file by 3 seconds or more.

 [5/5] from: ptretter::charter::net at: 22-Jul-2001 9:30


I agree. But, I also see an advantage to it also. For example if you were checking the date and timestamp of a file on the remote server it may have been changed due to a server process or other related problem. Maybe the index icon info block should be used only to override the actual file's date stamp on the remote. This way you get the best of both worlds and fits in line with the REBOL philosoply that easy things should be easy to do. Also, add a way to get a completely new index.r refresh also. Paul Tretter

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted