> Regarding your scripts. Like you I have a need to upload files, but I also
> have a need to download files regularly. I would appreciate it if you could
> describe how your script checks for a connection and how it has been
> installed as a service under windows NT. I've other uses in mind for such a
> capability.
On my setup, the rebol function 'connected? isn't reliable. I think
this is due to the fact I have both a network card and a modem (pc
cards on a laptop), so I had to find another way to check for a
connection.
The solution I retained is a batch file that loops and spits every
minute the following standard NT command : route.exe print > route.txt
The Rebol script on its turn reads every minute "route.txt" and
compares it with the not-connected route (localhost).
This is what I call the default route :
default-route:
{===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 00 00 00 00 00 ...... NdisWan Adapter
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
255.255.255.255 255.255.255.255 255.255.255.255 2 1
===========================================================================
}
So now, the following very simple check tells you if you're connected
or not :
forever [ wait 00:01
now-route: read %route.txt
either [now-route = default-route] [connected: to-logic false][connected:
to-logic true]
either connected [
print "connected"
do %whatever-you-want-to-do-when-connected.r
]
[
print "not connected"
do %whatever-you-want-to-do-when-not-connected.r
]
]
Regarding your second question concerning NT services, you need a file
called srvany.exe available for free from the NT resource kit (or some
truncated version of the resource kit that you can download on the
Microsoft web site).
Hope this helps, fantam
> Thanks
> Brett.
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, October 19, 2000 7:29 PM
> Subject: [REBOL] Rebol (fwd)
>>
>>
>> ---------- Forwarded message ----------
>> Date: Thu, 19 Oct 2000 06:23:22 +0200
>> From: Fantam <[EMAIL PROTECTED]>
>> To: [EMAIL PROTECTED]
>> Subject: Rebol
>>
>> Hello all,
>>
>> Some time ago on this list, there was a discussion regarding usage
>> examples of Rebol -- how people actually use Rebol. This is an
>> interesting topic for various reasons, and I decided to share with
>> you one way I use rebol.
>> First of all, I have to specify that I program for "domestic"
>> reasons, and not in a professional way.
>> That said, I can now tell how I put my first steps of Rebol in use.
>> What I wanted was a program that could detect if I am connected, and
>> if so, upload recently modified files to a ftp server. The important
>> thing was to automate everything, so it would run in the background
>> with no user interaction. Since I use NT, I installed the scripts as
>> services (services are processes that can run independently
>> of the current logged user).
>> The code was not very complicated to write, but to make the program
>> run reliably took some time and revealed a couple of weak points or
>> bugs with Rebol, some not solved yet.
>> The two bugs related to the ftp scheme in Rebol are:
>> a, Impossible to 'read filenames with spaces.
>> b, Bug with 'exists?.
>> With some hacks though, it was possible to accomplish the objective of
> the
>> program, and it runs solidly for some time now.
>>
>> That's it. Maybe this will give someone ideas. Any further questions
>> welcome.
>>
>> Note: RT are aware of the aforementionned bugs.
>>
>> --
>> mailto:[EMAIL PROTECTED]
>>
>>
>>
>> --
>> To unsubscribe from this list, please send an email to
>> [EMAIL PROTECTED] with "unsubscribe" in the
>> subject, without the quotes.
>>
--
mailto:[EMAIL PROTECTED]
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.