This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
pinkel
Voice
Posts: 8 Joined: Wed May 21, 2008 2:59 pm
Post
by pinkel » Sat May 31, 2008 5:30 am
Is it possible to use wget in .tcl?
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sat May 31, 2008 6:51 am
You can execute shell commands using the [exec] Tcl command.
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Sat May 31, 2008 7:03 am
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
pinkel
Voice
Posts: 8 Joined: Wed May 21, 2008 2:59 pm
Post
by pinkel » Sat May 31, 2008 7:43 am
so someting like this will work?
Code: Select all
[exec wget -O -b /var/www/temp/$filename $url]
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Sat May 31, 2008 3:20 pm
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: Select all
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: Select all
exec wget -b -O /var/www/temp/$filename $url
NML_375
Elfriede
Halfop
Posts: 67 Joined: Tue Aug 07, 2007 4:21 am
Post
by Elfriede » Wed Feb 10, 2010 7:27 pm
i know an old thread, but how to make that run completely in the background or minimized? can someone please help
Code: Select all
set somevar [exec wget -b -O /var/www/temp/$filename $url]