| View previous topic :: View next topic |
| Author |
Message |
pinkel Voice
Joined: 21 May 2008 Posts: 8
|
Posted: Sat May 31, 2008 5:30 am Post subject: wget tcl |
|
|
| Is it possible to use wget in .tcl? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat May 31, 2008 6:51 am Post subject: |
|
|
You can execute shell commands using the [exec] Tcl command. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat May 31, 2008 7:03 am Post subject: |
|
|
Be advised that exec will block code execution while the command is executed, so downloading large files or accessing slow servers this way may cause your bot to become unresponsive for some time and possibly disconnect from the irc network. You could of course tell wget to run in bg-mode using the -b flag, which would make the exec-command return instantly.
Another way is to use pipes with open, and then user fileevents to read any output from the command. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
pinkel Voice
Joined: 21 May 2008 Posts: 8
|
Posted: Sat May 31, 2008 7:43 am Post subject: |
|
|
so someting like this will work?
| Code: |
[exec wget -O -b /var/www/temp/$filename $url]
|
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat May 31, 2008 3:20 pm Post subject: |
|
|
Yes, kind of. Since wget will return immediately, it really won't return anything useful, so I don't see any use for the [].
Edit:
To be abit more clear;
| Code: | | set somevar [exec wget -b -O /var/www/temp/$filename $url] |
This will not produce much interesting information into somevar, and you might just aswell just do like this:
| Code: | | exec wget -b -O /var/www/temp/$filename $url |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Elfriede Halfop
Joined: 07 Aug 2007 Posts: 67
|
Posted: Wed Feb 10, 2010 7:27 pm Post subject: |
|
|
i know an old thread, but how to make that run completely in the background or minimized? can someone please help
| Code: |
set somevar [exec wget -b -O /var/www/temp/$filename $url]
|
|
|
| Back to top |
|
 |
|