Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!apple!oliveb!amiga!cbmvax!jesup From: jesup@cbmvax.UUCP (Randell Jesup) Newsgroups: comp.sys.amiga.tech Subject: Re: problem with Manx's getenv() (and AmigaDOS enviroment variables) Message-ID: <7189@cbmvax.UUCP> Date: 30 Jun 89 20:39:48 GMT References: <57878@linus.UUCP> Reply-To: jesup@cbmvax.UUCP (Randell Jesup) Organization: Commodore Technology, West Chester, PA Lines: 32 In article <57878@linus.UUCP> rachamp@mbunix.mitre.org (Champeaux) writes: > > I'm trouble using getenv() from inside a handler. If I call getenv() >before 'set' has been executed, the system hangs. It doesn't matter what >variable has been set, just so long as set is executed before the >getenv() is called. I tried calling setenv() to set a dummy variable >immediately before calling getenv(), but then it crashes on the setenv(). This is because the "enviroment.library" that manx uses doesn't exist (it SHOULDN'T have been a library), and OpenLibrary tries to load it from disk (doing Dos calls, of course). > Also, I had thought about scapping support of Manx enviroment variables, >and just use the AmigaDOS ones. But, my God, they sure are hard to get at >from inside a handler. You can't use Open(), Read(), or Close() from inside >a handller, so you have to build the packets and send them yourself. Yup. Standard trick is to spawn off a subroutine as a process, and have it read the variable and send your handler the value. >Any help would be greatly appreciated. Especially if it's example code on how >to create a packet and send it to a handler. I've dealt with packets from >the handler's side, but there's not much to do there; just play with the >arguments and call returnpkt() when your done. Important thing when writing a handler: dp_Port MUST be set to your process message port by replypkt() - some programs use this to "ping-pong" packets. When queuing packets to a handler, dp_Port must be set to your reply port (usually your process message port). -- Randell Jesup, Commodore Engineering {uunet|rutgers|allegra}!cbmvax!jesup