[Pharo-project] yielding to command line
Hi, I have the following requirement: - I start an image from the command line with an initial script - I want to wait until the Smalltalk script finishes until I can continue with the command line script - But, I do not want to stop the image I can achieve the first two points by having the image quit at the end. Is there a way in which I can somehow continue the command line execution without stopping the image? Cheers, Doru -- www.tudorgirba.com "Every thing has its own flow"
On 2012-11-14, at 11:07, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
I have the following requirement: - I start an image from the command line with an initial script - I want to wait until the Smalltalk script finishes until I can continue with the command line script - But, I do not want to stop the image
I can achieve the first two points by having the image quit at the end. Is there a way in which I can somehow continue the command line execution without stopping the image?
I don't know the details but if you save+quit your image and immediately open it again it will continue where you where before. so the following is the closest thing I can come up with ./vm.sh Pharo.image st doStuffAndSave.st; ./vm.sh Pharo.image & # relaunch and fork to background ./doStuffAfter.sh but yeah, that violates your not-image-stop requirement :)
Hi, Actually, the reason why I cannot use this solution is that on Windows, when I have a large enough image, I can build it, I can save it even, but I cannot reopen it. Hence my only way around it is to not close it :). Cheers, Doru On 15 Nov 2012, at 14:23, Camillo Bruni <camillobruni@gmail.com> wrote:
On 2012-11-14, at 11:07, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
I have the following requirement: - I start an image from the command line with an initial script - I want to wait until the Smalltalk script finishes until I can continue with the command line script - But, I do not want to stop the image
I can achieve the first two points by having the image quit at the end. Is there a way in which I can somehow continue the command line execution without stopping the image?
I don't know the details but if you save+quit your image and immediately open it again it will continue where you where before. so the following is the closest thing I can come up with
./vm.sh Pharo.image st doStuffAndSave.st; ./vm.sh Pharo.image & # relaunch and fork to background ./doStuffAfter.sh
but yeah, that violates your not-image-stop requirement :)
-- www.tudorgirba.com "Being happy is a matter of choice."
How about forking directly at the beginning, then busy wait in bash for a certain file to be created at the end of the st script and only then continue. Ugly but should work On 15 Nov 2012 16:06, "Tudor Girba" <tudor@tudorgirba.com> wrote:
Hi,
Actually, the reason why I cannot use this solution is that on Windows, when I have a large enough image, I can build it, I can save it even, but I cannot reopen it. Hence my only way around it is to not close it :).
Cheers, Doru
On 15 Nov 2012, at 14:23, Camillo Bruni <camillobruni@gmail.com> wrote:
On 2012-11-14, at 11:07, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
I have the following requirement: - I start an image from the command line with an initial script - I want to wait until the Smalltalk script finishes until I can
continue
with the command line script - But, I do not want to stop the image
I can achieve the first two points by having the image quit at the end. Is there a way in which I can somehow continue the command line execution without stopping the image?
I don't know the details but if you save+quit your image and immediately open it again it will continue where you where before. so the following is the closest thing I can come up with
./vm.sh Pharo.image st doStuffAndSave.st; ./vm.sh Pharo.image & # relaunch and fork to background ./doStuffAfter.sh
but yeah, that violates your not-image-stop requirement :)
-- www.tudorgirba.com
"Being happy is a matter of choice."
How about: FD=3 exec $FD< <(nohup ./vm.sh Pharo.image st doStuffAndSave.st) read -n 1 -u $FD echo $REPLY exec $FD<&- runs image in background, reads one character from it's output, and output's it. Will close the $FD (file descriptor at the end) See: http://wiki.bash-hackers.org/commands/builtin/read http://ubuntuforums.org/showthread.php?t=979694 Works probably with a cygwin bash, too. On 15 Nov 2012, at 16:45, Bruni camillo wrote:
./vm.sh Pharo.image st doStuffAndSave.st; ./vm.sh Pharo.image & # relaunch and fork to background ./doStuffAfter.sh
but yeah, that violates your not-image-stop requirement :)
-- www.tudorgirba.com
"Being happy is a matter of choice."
-- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
How about fixing windows VM? Ugly but should work :) On 15 November 2012 12:45, Bruni camillo <camillobruni@gmail.com> wrote:
How about forking directly at the beginning, then busy wait in bash for a certain file to be created at the end of the st script and only then continue.
Ugly but should work
On 15 Nov 2012 16:06, "Tudor Girba" <tudor@tudorgirba.com> wrote:
Hi,
Actually, the reason why I cannot use this solution is that on Windows, when I have a large enough image, I can build it, I can save it even, but I cannot reopen it. Hence my only way around it is to not close it :).
Cheers, Doru
On 15 Nov 2012, at 14:23, Camillo Bruni <camillobruni@gmail.com> wrote:
On 2012-11-14, at 11:07, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
I have the following requirement: - I start an image from the command line with an initial script - I want to wait until the Smalltalk script finishes until I can continue with the command line script - But, I do not want to stop the image
I can achieve the first two points by having the image quit at the end. Is there a way in which I can somehow continue the command line execution without stopping the image?
I don't know the details but if you save+quit your image and immediately open it again it will continue where you where before. so the following is the closest thing I can come up with
./vm.sh Pharo.image st doStuffAndSave.st; ./vm.sh Pharo.image & # relaunch and fork to background ./doStuffAfter.sh
but yeah, that violates your not-image-stop requirement :)
-- www.tudorgirba.com
"Being happy is a matter of choice."
-- Best regards, Igor Stasenko.
participants (5)
-
Bruni camillo -
Camillo Bruni -
Igor Stasenko -
Stefan Marr -
Tudor Girba