Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!iconsys!caeco!i-core!geo-works!bryan From: bryan@geo-works.UUCP (Bryan Ford) Newsgroups: comp.sys.amiga.tech Subject: Finding task and stdin/stdout handle pointers Message-ID: <1727.AA1727@geo-works> Date: 14 Jul 89 11:46:15 GMT Followup-To: comp.sys.amiga.tech Lines: 30 Is it naughty to get your task/process structure pointer by using 'SysBase->ThisTask' instead of 'FindTask(0L)'? I know for a fact that this will work fine for the current version of the OS, but how about future versions? Also, is it naughty to get the current input/output streams for your process by using 'ProcPtr->pr_CIS' and 'ProcPtr->pr_COS' instead of 'Input()' and 'Output()', respectively? How about 'ProcPtr->pr_Result2' and 'IoErr()'? The direct methods are much better the function-calling methods, especially seeing how the dos.library handles its calls. (Try stepping through a dos.library call with a debugger. Uhgg!) Before you go and say 'DON'T DO IT!', consider that SysBase is used by many programs to find out what type of processor and display is used, and ThisTask should always be implemented. It is a *public* structure. And the pr_CIS and pr_COS handles and pr_Result2 are part of *your* *private* process structure, which many programs access in many different ways anyway, so I don't think either of these structures can change too much, besides possibly being extended. Discussion, anybody? Bryan -- ____________________________________________ _/ Bryan Ford - bryan@geo-works.geo-works.com \_ _/ ..!utah-cs!caeco!i-core!geo-works!bryan \_ / ..!uunet!iconsys!caeco!i-core!geo-works!bryan \