Path: news.cs.au.dk!not-for-mail From: "Sascha Kimmel" Newsgroups: comp.lang.beta Subject: RE: problems with processes Date: 27 Feb 1999 22:14:34 -0000 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 167 Approved: mailtonews@cs.au.dk Distribution: world Message-ID: <19990227221434.23193.qmail@noatun.mjolner.dk> Reply-To: "Sascha Kimmel" NNTP-Posting-Host: daimi.cs.au.dk X-Trace: xinwen.cs.au.dk 920153676 1014 255.255.255.255 (27 Feb 1999 22:14:36 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 27 Feb 1999 22:14:36 GMT Xref: news.cs.au.dk comp.lang.beta:11843 > -----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. > 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? > TextToPrint[]->&lpr_process; Doesn't TextToPrint[]->lpr_process; do the stuff alone? > #) > > > 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. > #); > > 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;>> > 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. > > > > 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)