Path: news.cs.au.dk!not-for-mail From: Arne Hueggenberg Newsgroups: comp.lang.beta Subject: RE: problems with processes Date: 28 Feb 1999 10:24:22 -0000 Organization: University of Dortmund Lines: 191 Approved: mailtonews@cs.au.dk Distribution: world Message-ID: <19990228102422.24547.qmail@noatun.mjolner.dk> Reply-To: Arne Hueggenberg NNTP-Posting-Host: daimi.cs.au.dk X-Trace: xinwen.cs.au.dk 920197474 13227 255.255.255.255 (28 Feb 1999 10:24:34 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 28 Feb 1999 10:24:34 GMT Xref: news.cs.au.dk comp.lang.beta:11845 On Sat, 27 Feb 1999, you wrote: >> -----Ursprüngliche Nachricht----- >> Von: Arne Hüggenberg [mailto:zalaster@nef.wh.uni-dortmund.de] >> Gesendet am: Samstag, 27. Februar 1999 20:17 >> An: usergroup@mjolner.dk >> Betreff: problems with processes >> >> Hello everyone, >> i have a problem im hoping someone here can me help with >> Using the PE for Linux im trying to do something like this: >> lprtest.bet: > >I'm using BETA 4.1 Pro on Win98 the most time, but sometimes also under >Linux, but don't expect too much help for BETA under Linux from me ;-) >But I'll try. As we are working on an system independent abstraction layer (e.g. the BETA Process Lib) that shouldnt matter. Except that due to the unix way of combining several small tools for a greater whole processes are much more usful on unix :-) >> ORIGIN '~beta/basiclib/current/systemenv'; >> INCLUDE 'lpr'; >> >> -- program:descriptor -- >> systemenv >> (# >> TextToPrint: ^TEXT; >> do >> &text[]->TextToPrint[]; >> 'this is a test'->TextToPrint.putline; >> 'wonder if this works'->TextToPrint.putline; > >Haven't tried it this way, but it works the same way as 'this is a >test'->TextToPrint.append , or am I totally wrong now? >But doesn't PUTLINE always append a NEWLINE to a text string? yes it does, and the NEWLINE is intended >> TextToPrint[]->&lpr_process; > >Doesn't TextToPrint[]->lpr_process; do the stuff alone? it should, but it never hurts to be explicit does it? :-) >> #) >> >> >> with lpr.bet being: >> >> ORIGIN '~beta/basiclib/current/systemenv'; >> INCLUDE '~beta/process/current/processmanager'; >> -- Systemlib: Attributes -- >> lpr_process: Systemenv >> (# >> PrintMe: ^TEXT; >> exec: >> (# name: ^text; child: @process; >> enter name[] >> do >> name[]->child.init; >> printme[]->child.RedirectFromChannel; >> child.start; >> child.awaitStopped; > >Freezes the program until the process has finished. yep, but thats totally aceeptable for a small demo program isnt it? >> #); >> >> enter PrintMe[] >> do 'starting lpr_process'->putline; >> ('/usr/bin/lpr')->exec; >> #); >> >> >> now what happens is that an execution of lprtest.bet results in: >> >> arne@darkwing:~/code > ./lprtest >> >> ******************************************************************* >> * Note: This program was compiled using a Personal Edition of the * >> * Mjolner BETA System and may not be used for commercial purposes * >> ******************************************************************* >> >> >> FORK FAILURE: Only newly created systems may be forked. >> >> # Beta execution aborted: Stop is called. >> # Look at 'lprtest.dump' >> >> with the dump file being >> >> arne@darkwing:~/code > cat lprtest.dump >> Beta execution aborted: Stop is called. >> >> Call chain: (linux) >> >> item in ~beta/basiclib/v1.6/private/betaenvbody >> -- stop# in ~beta/basiclib/v1.6/betaenv >> item in ~beta/basiclib/v1.6/betaenv >> -- BETAENV-~ in ~beta/basiclib/v1.6/betaenv >> item in ~beta/basiclib/v1.6/private/basicsystemenvbody >> -- fork# in ~beta/basiclib/v1.6/basicsystemenv >> item in ~beta/basiclib/v1.6/basicsystemenv >> -- lpr_process#SystemEnv#SysHead# in /home/arne/code/lpr >> item in ~beta/basiclib/v1.6/private/basicsystemenvbody >> -- BASICSYSTEMENVPRIVATE-~ in >> ~beta/basiclib/v1.6/private/basicsystemenvbody >> item in >> ~beta/basiclib/v1.6/private/basicsystemenvbody >> -- lpr_process#SystemEnv#SysHead# in /home/arne/code/lpr >> item lpr_process#SysHead# in >> ~beta/basiclib/v1.6/basicsystemenv >> -- BETAENV-~ in ~beta/basiclib/v1.6/betaenv >> comp SystemEnv#SysHead# in /home/arne/code/lprtest >> -- BETAENV-~ in ~beta/basiclib/v1.6/betaenv >> >> >> item realValue# in >> ~beta/basiclib/v1.6/private/basicsystemenvbody >> -- BASICSYSTEMENVPRIVATE-~ in >> ~beta/basiclib/v1.6/private/basicsystemenvbody >> item <*>cycle# in ~beta/basiclib/v1.6/private/systemenv_unixbody >> -- BASICSCHEDULER-~ in >> ~beta/basiclib/v1.6/private/systemenv_unixbody >> comp in >> ~beta/basiclib/v1.6/private/systemenv_unixbody >> -- PROGRAM-~SystemEnv#SysHead# in /home/arne/code/lprtest >> >> >> basic component in ~beta/basiclib/v1.6/betaenv >> >> >> and im dont quite understand why this doesent work as i expect. >> >> >> >> Also, when putting it all in one file it seems to work fine, except for >> the fact that >> >> PrintMe[]->RedirectFromChannel; >> >> results in : >> >> # Beta execution aborted: Qualification error in reference assignment. >> # Look at 'lpr.dump' > >It's obvious that if there's no process to which the string should be >redirected to, there is a little problem. >Try <child.RedirectFromChannel;>> some checking is in order here, but remember, the code only serves to demonstrate my problem in the second case, where i change lpr.bet so that everything happens in it there is a process, note that it dumps with an qualification error (e.g. some reference is passed wich is not properly qualified) not ´reference is none´ The qualification error is what has me wondering, as text is stronger qualified than stream it should be no problem to pass it to a method expecting a stream. even changing the texts qualification to stream doesent help so im guessing its something else, but i dont understand what. >> trying to be clever i then did >> >> PrintMe[]->qua(# as::< stream #)->RedirectFromChannel; >> >> >> but to no avail, still dumps with the same qualification error in >> reference assignment > >See above. see above :-) >> >> >> >> anyone know what im doing wrong? >> >> any help would be appreciated :-) >> >> Arne Hüggenberg >> > >Hope this helps at least a bit :) > >Reagrds, >Sascha Kimmel >(kimmel@tricos.com) Arne Hueggenberg