| View previous topic :: View next topic |
| Author |
Message |
haferbrei Voice
Joined: 08 Apr 2020 Posts: 23
|
Posted: Mon Apr 12, 2021 7:14 pm Post subject: thread |
|
|
I want to run a bash script that packs folders. This takes a little time and during this time the bot is not responsive.
How can I move the script to a thread?
| Code: | set zipper [thread::create {
puts "Starting zipper thread"
exec bash.script
}] |
Unfortunately, this does not work. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Mon Apr 12, 2021 10:43 pm Post subject: Re: thread |
|
|
| haferbrei wrote: |
...
How can I move the script to a thread?
...
|
I think there is a Thread package. However I am not familiar with it. Maybe someone else here will comment on it.
You're running into what is called: blocking.
I'm fuzzy on this - been a long time - but you can use the
open
command with pipes to deal with this.
No doubt you can use the search function here in the forum, and find lots on the open command.
Perhaps even something on that Thread package, too.
Here's one post that might interest you:
http://forum.egghelp.org/viewtopic.php?p=100611
I see a comment in some code there:
| Code: |
...
# Description:
#
# This script is for other scripters to use as a replacement
# for the "exec" command so that they may execute commands to
# the system in the background. (non-blocking mode)
...
|
which sure sounds like what you are looking for.
Have a read, and see if there is anything there of use to you.
I'm sorry that I can't give you a more direct answer.
I hope this helps. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
haferbrei Voice
Joined: 08 Apr 2020 Posts: 23
|
Posted: Mon Apr 19, 2021 4:40 pm Post subject: Re: thread |
|
|
| willyw wrote: |
I'm fuzzy on this - been a long time - but you can use the
open
command with pipes to deal with this.
|
i tried it with &, but it doesnt help at all. I get the message (!) timer drift -- spun 2 minutes |
|
| Back to top |
|
 |
|