[REBOL] Re: Comparing local and remote files
From: rebol-list2:seznam:cz at: 20-Dec-2002 16:19
Hello Tim,
Wednesday, December 18, 2002, 7:27:52 AM, you wrote:
TJ> Hi All:
TJ> Given a list of files: I'd like to:
TJ> 1)Confirm that a copy of any file in the list exists
TJ> both on a remote directory and on my local machine.
TJ> 2)Compare both copies to see if they are of the same size.
TJ> Any ideas of where to start?
TJ> Here's a track of a console session -
>>> probe info? http://www.rebol.com/faq.html
TJ> connecting to: www.rebol.com
TJ> make object! [
TJ> size: 79336
TJ> date: 12-Dec-2002/7:32:48
TJ> type: 'file
TJ> ]
TJ> :-)
>>> exists? http://www.johnsons-web.com/cgi-bin/wmj/WmjSearch.r
TJ> connecting to: www.johnsons-web.com
TJ> == true
>>> probe info? http://www.johnsons-web.com/cgi-bin/wmj/WmjSearch.r
TJ> connecting to: www.johnsons-web.com
TJ> make object! [
TJ> size: 0
TJ> date: none
TJ> type: 'file
TJ> ] ; <sigh/>
TJ> --
Info? is using the informations send by the server. If it's a script,
the server don't know what size of the output will be, so it's 0 and
the date is none (or the date you specify in your script).
>> o: open/direct/no-wait http://127.0.0.1/index.html
>> probe o/locals
make object! [
list: []
headers:
make object! [
Date: "Fri, 20 Dec 2002 11:51:08 GMT"
Server: "Apache/1.3.9 (Win32) PHP/4.2.3"
Last-Modified: "Wed, 13/Nov/2002/16:55:00/+GMT"
Accept-Ranges: "bytes"
Content-Encoding: none
Content-Type: "text/html"
Content-Length: "1414"
Location: none
Expires: none
Referer: none
Connection: "close"
Authorization: none
ETag: {"0-586-3dd283e4"}
content: ""
]
]
>> o/date
== 13-Nov-2002/16:55
>> o/status
== file
>> close o
>> o: open/direct/no-wait http://127.0.0.1/cgi-bin/probecgi.r
>> probe o/locals
make object! [
list: []
headers:
make object! [
Date: "Fri, 20 Dec 2002 11:54:32 GMT"
Server: "Apache/1.3.9 (Win32) PHP/4.2.3"
Last-Modified: none
Accept-Ranges: none
Content-Encoding: none
Content-Type: "text/html"
Content-Length: none
Location: none
Expires: none
Referer: none
Connection: "close"
Authorization: none
content: ""
]
]
>> close o
If someone don't know what is the 'list block in the port/locals ->
it's used to store forwarded urls for the circular detection.
=( Oliva David )=======================( [oliva--david--seznam--cz] )==
=( Earth/Europe/Czech_Republic/Brno )=============================
=( coords: [lat: 49.22 long: 16.67] )=============================