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

[REBOL] Re: Comparing local and remote files

From: chalz:earthlink at: 18-Dec-2002 3:03

Mind, I'm far from an authority on this matter, but I think I might know what's up. I can sum it up right here:
>> exists? ftp://usr:[pwd--www--chalz--net]/www/cgi-bin/test.r
== true
>> exists?
connecting to: == false
The problem is it's a script. It gets evaluated, so while the URL does exist, you will never receive the file. What you receive is some HTML content, and it is variable. The file does not get read directly, only executed. You'll have to either execute your compare code from the remote host, and instead treat your local machine as remote, or settle for an FTP connection. For instance, if I try, with my web site:
>> exists?
connecting to: == true
>> probe info?
connecting to: make object! [ size: 0 date: none type: 'file ]
>> probe info? ftp://usr:[pwd--www--chalz--net]/www/cgi-bin/roll
make object! [ size: 2117 date: 26-Nov-2002/12:39 type: 'file ]
Bingo. Since it's in cgi-bin, it won't return the contents of the file, only the evaluated result. I tried it with a test file, which printed "hello world". I set it up as readable and executable, exists? http://... sees it, but info? returns a dead object. I make it non-executable, and exists? http://... no longer sees it. Hope this helps :) --Charles